Hi,
Apple has yet again changed the way it handles how it allows the gyroscope to function on safari in iOS 13. They removed the "motion and orientation access" toggle in the settings. Now you're supposed to be able to use a permissions API to prompt the user to allow the phone to grant access to the accelerometer.
Apple didn't supply any documentation on how to accomplish this. Has anyone taken a crack at it and found a solution? Any help is greatly appreciated.
Thanks,
Jesse
iOS 13 gyroscope changes
-
- Posts: 38
- Joined: Thu May 30, 2019 1:47 pm
I hope this gets a follow up once available.
i Think I found the solution, I just don’t know how to implement it...
Permissions APIs have been created for DeviceMotionEvent and DeviceOrientationEvent.
Link:
https://developer.apple.com/documentati ... nguage=occ
Scroll down a bit to “ Security and Privacy”
Can anyone explain how to add this to a site? My best guess is to add specific code to a button in the “goto url” function in actions. but just a guess.
Thanks!
Jesse
Permissions APIs have been created for DeviceMotionEvent and DeviceOrientationEvent.
Link:
https://developer.apple.com/documentati ... nguage=occ
Scroll down a bit to “ Security and Privacy”
Can anyone explain how to add this to a site? My best guess is to add specific code to a button in the “goto url” function in actions. but just a guess.
Thanks!
Jesse
Really interested to know more about this!!!!
here's the most conclusive article I've found, but I don't know how to apply the code into the skin. I'm hoping somebody can figure it out and share with the community...
https://tinyurl.com/y3phm82o
from the article:
"To request permission, we would just need to call a method on the DeviceMotionEvent or DeviceOrientationEvent: requestPermission It would return a promise that always resolve to a PermissionState which could be granted or denied (so basically Promise<'granted'|'denied'>)."
The code to copy
For devicemotion events:
function onClick() {
// feature detect
if (typeof DeviceMotionEvent.requestPermission === 'function') {
DeviceMotionEvent.requestPermission()
.then(permissionState => {
if (permissionState === 'granted') {
window.addEventListener('devicemotion', () => {});
}
})
.catch(console.error);
} else {
// handle regular non iOS 13+ devices
}
}
and for deviceorientation events:
function onClick() {
// feature detect
if (typeof DeviceOrientationEvent.requestPermission === 'function') {
DeviceOrientationEvent.requestPermission()
.then(permissionState => {
if (permissionState === 'granted') {
window.addEventListener('deviceorientation', () => {});
}
})
.catch(console.error);
} else {
// handle regular non iOS 13+ devices
}
}
Hopefully someone will know how to apply this to pano2vr skins.
Best,
Jesse
https://tinyurl.com/y3phm82o
from the article:
"To request permission, we would just need to call a method on the DeviceMotionEvent or DeviceOrientationEvent: requestPermission It would return a promise that always resolve to a PermissionState which could be granted or denied (so basically Promise<'granted'|'denied'>)."
The code to copy
For devicemotion events:
function onClick() {
// feature detect
if (typeof DeviceMotionEvent.requestPermission === 'function') {
DeviceMotionEvent.requestPermission()
.then(permissionState => {
if (permissionState === 'granted') {
window.addEventListener('devicemotion', () => {});
}
})
.catch(console.error);
} else {
// handle regular non iOS 13+ devices
}
}
and for deviceorientation events:
function onClick() {
// feature detect
if (typeof DeviceOrientationEvent.requestPermission === 'function') {
DeviceOrientationEvent.requestPermission()
.then(permissionState => {
if (permissionState === 'granted') {
window.addEventListener('deviceorientation', () => {});
}
})
.catch(console.error);
} else {
// handle regular non iOS 13+ devices
}
}
Hopefully someone will know how to apply this to pano2vr skins.
Best,
Jesse
shouldn't this be integrated into the skin element (gyroscope) by ggnome???
-
- Posts: 38
- Joined: Thu May 30, 2019 1:47 pm
That would be great, I hope Hopki is on it.
The next update will solve this directly in the Pano2VR player.
MfG, Thomas
Thomas, thank you for the quick program update to this ever changing gyroscope issue. I have updated to the latest version (6.1). I see in the release notes that there is now a fix for iOS 13:
“ A fix has been added to allow access to the gyroscope in iOS 13 (update your projects to the latest player)”
Is there a quick answer to what the fix is that has been added, or will you be releasing further info in the future.
Thanks again for all you do!
Regards,
Jesse
“ A fix has been added to allow access to the gyroscope in iOS 13 (update your projects to the latest player)”
Is there a quick answer to what the fix is that has been added, or will you be releasing further info in the future.
Thanks again for all you do!
Regards,
Jesse
If you click on the Gyro button (or Enter VR) we automatically request permission to use the gyroscope. No other changes should be needed.
MfG, Thomas
- Hopki
- Gnome
- Posts: 13004
- Joined: Thu Jan 10, 2008 3:16 pm
- Location: Layer de la Haye, Essex UK
- Contact:
Hi Guys,
I will add as and when the message shows to activate the gyro, if you dismiss it, then it's gone for good.
What you need to do is go to the iPhone settings, Safari and select Clear History and Website Data.
Then next time you visit the site it will then ask again do you want to use the gyro.
Regards,
Hopki
I will add as and when the message shows to activate the gyro, if you dismiss it, then it's gone for good.
What you need to do is go to the iPhone settings, Safari and select Clear History and Website Data.
Then next time you visit the site it will then ask again do you want to use the gyro.
Regards,
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/