Safari - Unable to re-request the DeviceMotionEvent after pressing Cancel
I am unable to re-request the permission regarding the DeviceMotionEvent after the user has pressed Cancel. The code is as follows:
function requestMotionPermission() {
DeviceMotionEvent.requestPermission().then(permissionState => {
if (permissionState == 'granted') {
// ...
} else {
console.log("permission not granted")
}
})
}
it is triggered by an onClick event from a html button. The workaround would be to force quit and re-open the browser, but this is not an elegant fix. Is there any way I could clear the DeviceMotionEvent result and re-do the permission?
iPhone 15 Pro Max, iOS 17