Page 1 of 2

iOS 13 gyroscope changes

Posted: Sun Sep 22, 2019 10:40 pm
by Jmondo
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

Re: iOS 13 gyroscope changes

Posted: Tue Sep 24, 2019 7:48 am
by KMiddelkoop
I hope this gets a follow up once available.

Re: iOS 13 gyroscope changes

Posted: Tue Sep 24, 2019 3:01 pm
by Jmondo
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

Re: iOS 13 gyroscope changes

Posted: Wed Sep 25, 2019 5:00 am
by edgar_ali
Really interested to know more about this!!!!

Re: iOS 13 gyroscope changes

Posted: Wed Sep 25, 2019 2:18 pm
by Jmondo
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

Re: iOS 13 gyroscope changes

Posted: Fri Sep 27, 2019 4:47 am
by edgar_ali
shouldn't this be integrated into the skin element (gyroscope) by ggnome???

Re: iOS 13 gyroscope changes

Posted: Fri Sep 27, 2019 8:43 pm
by KMiddelkoop
That would be great, I hope Hopki is on it.

Re: iOS 13 gyroscope changes

Posted: Fri Sep 27, 2019 11:23 pm
by thomas
The next update will solve this directly in the Pano2VR player.

Re: iOS 13 gyroscope changes

Posted: Sat Sep 28, 2019 4:05 pm
by Jmondo
Thanks Thomas!

Re: iOS 13 gyroscope changes

Posted: Wed Oct 02, 2019 1:52 pm
by Jmondo
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

Re: iOS 13 gyroscope changes

Posted: Wed Oct 02, 2019 2:20 pm
by thomas
If you click on the Gyro button (or Enter VR) we automatically request permission to use the gyroscope. No other changes should be needed.

Re: iOS 13 gyroscope changes

Posted: Wed Oct 02, 2019 3:03 pm
by Jmondo
Thanks for the quick response. Unfortunately I’m not seeing a “gyro” or “enter vr” button. Is this a setting in the skin?

Re: iOS 13 gyroscope changes

Posted: Wed Oct 02, 2019 3:08 pm
by Jmondo
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!

Re: iOS 13 gyroscope changes

Posted: Thu Oct 03, 2019 8:29 am
by Jeffreycb
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

Re: iOS 13 gyroscope changes

Posted: Thu Oct 03, 2019 5:09 pm
by Hopki
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