Open mysterycommand opened 5 years ago
The Permission API for DeviceOrientation does work in iOS 13 using the standard pattern.
DeviceOrientationEvent.requestPermission().then((_result) => {
if (_result == 'granted') { // or invert this and check for denied/dismissed
...
}
});
But there are 2 key issues you'll face!
deny
then it seems there's no way to clear this at all 8(We'll ping @chris_dumez on twitter for more info as he suggested https://github.com/w3c/deviceorientation/issues/57#issuecomment-498417027
Hi! Any luck with Safari caching the user's permission decision? I'm facing the same exact issue =/ The DeviceOrientationEvent.requestPermission() returns 'denied' no matter what I do
@alfeugds I have not figured out a way to re-request permission if it's been denied previously. I think we might be stuck prompting our users to go into Settings and toggle the permission themselves … which sounds like something people won't likely do?
It turns out that you can just restart Safari on iOS and it will forget all permissions. Not great, but at least it's reversible if you accidentally hit deny (for what it's worth there's no longer any permissions in the Settings app either).
I am so frustrated with freaking Apple's elusive coding practices but had to at least share one piece of positive feedback. As @mysterycommand and @alfeugds and @newhouseb have pointed out, denials of permissions are cached and can be reset by restarting Safari. The positive side of permissions caching is that, once permission has been granted, that also caches! Finally! A sliver of good news in a forest of less-than-good-news! :)
This is what I get on Safari:
This website allows immersion without requesting permission:
***edit: allows the 3D scene to display and be played but does not allow camera control (assuming due to lack of permissions as none are asked).
Does anyone know what technology they are using to achieve this?
I need a couple of 'windows' into my VR scenes for my website:
But at the moment I need to use extra CSS of:
pointer-events: none;
On my iframe in order to enable page scrolling on the iframe element but this takes away the ability to select the prompt.
Is there a way around this?
In iOS Safari 12.2+ permission needs to be enabled in settings for iPhones to fire
'devicemotion'
and'deviceorientation'
events … in iOS Safari 13 beta 3 release notes it appears they've implemented a permissions API but I can't find any documentation for it yet.See also: https://github.com/aframevr/aframe/issues/3976 … and: https://github.com/w3c/deviceorientation/issues/57#issuecomment-498417027