iOS 13 gyroscope changes

Q&A about the latest versions
Jmondo
Posts: 73
Joined: Thu Nov 16, 2017 11:10 am

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
KMiddelkoop
Posts: 38
Joined: Thu May 30, 2019 1:47 pm

I hope this gets a follow up once available.
Jmondo
Posts: 73
Joined: Thu Nov 16, 2017 11:10 am

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
User avatar
edgar_ali
Posts: 160
Joined: Wed May 03, 2017 12:00 pm
Location: Autralia
Contact:

Really interested to know more about this!!!!
Jmondo
Posts: 73
Joined: Thu Nov 16, 2017 11:10 am

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
User avatar
edgar_ali
Posts: 160
Joined: Wed May 03, 2017 12:00 pm
Location: Autralia
Contact:

shouldn't this be integrated into the skin element (gyroscope) by ggnome???
KMiddelkoop
Posts: 38
Joined: Thu May 30, 2019 1:47 pm

That would be great, I hope Hopki is on it.
User avatar
thomas
Chief Gnome
Posts: 2611
Joined: Fri Sep 01, 2006 3:56 pm
Location: Vienna, Austria
Contact:

The next update will solve this directly in the Pano2VR player.
MfG, Thomas
Jmondo
Posts: 73
Joined: Thu Nov 16, 2017 11:10 am

Thanks Thomas!
Jmondo
Posts: 73
Joined: Thu Nov 16, 2017 11:10 am

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
User avatar
thomas
Chief Gnome
Posts: 2611
Joined: Fri Sep 01, 2006 3:56 pm
Location: Vienna, Austria
Contact:

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
Jmondo
Posts: 73
Joined: Thu Nov 16, 2017 11:10 am

Thanks for the quick response. Unfortunately I’m not seeing a “gyro” or “enter vr” button. Is this a setting in the skin?
Jmondo
Posts: 73
Joined: Thu Nov 16, 2017 11:10 am

Thomas, please disregard my last reply, it is working. I now see how I have to rearrange my ux to make it work more intuitively. Thanks!
Jeffreycb
Posts: 23
Joined: Mon Mar 30, 2009 5:18 am

Sorry - I'm a bit slow to pickup on the discussion and have only just stumbled across this issue when I was testing a wordpress site.
I assume each project needs to be redone in the latest version of Pano2vr and be reposted?
Thanks
Jeffrey
User avatar
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
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/
Post Reply