Re: [deviceorientation] Add API for requesting permission to receive device motion / orientation events (#57)

> No, it doesn't. I cannot comment on _when_ it will ship but I have already agreed to post a message on this issue when the permission API becomes available in a public beta.

This is disappointing. I hope the API will make it into an update soon.

For anyone looking for a workaround, the best thing to do is to detect the disabled state via a timeout and clear it in the event handler. Something like this:

```
const id = setTimeout(() => alert('Enable device orientation in Settings > Safari > Motion & Orientation Access.'), 500);

window.addEventListener('deviceorientation', event => {
 clearTimeout(id);
 // ...
});
```



-- 
GitHub Notification of comment by neave
Please view or discuss this issue at https://github.com/w3c/deviceorientation/issues/57#issuecomment-476390630 using your GitHub account

Received on Monday, 25 March 2019 21:47:39 UTC