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

Posted on Apr 30, 2024 1:53 AM

Reply

There are no replies.

Safari - Unable to re-request the DeviceMotionEvent after pressing Cancel

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.