iOS 13 gyroscope changes

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

iOS 13 gyroscope changes

Post by Jmondo » Sun Sep 22, 2019 10:40 pm

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

Re: iOS 13 gyroscope changes

Post by KMiddelkoop » Tue Sep 24, 2019 7:48 am

I hope this gets a follow up once available.

Jmondo
Posts: 33
Joined: Thu Nov 16, 2017 11:10 am

Re: iOS 13 gyroscope changes

Post by Jmondo » Tue Sep 24, 2019 3:01 pm

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: 128
Joined: Wed May 03, 2017 12:00 pm
Location: Autralia
Contact:

Re: iOS 13 gyroscope changes

Post by edgar_ali » Wed Sep 25, 2019 5:00 am

Really interested to know more about this!!!!

Jmondo
Posts: 33
Joined: Thu Nov 16, 2017 11:10 am

Re: iOS 13 gyroscope changes

Post by Jmondo » Wed Sep 25, 2019 2:18 pm

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: 128
Joined: Wed May 03, 2017 12:00 pm
Location: Autralia
Contact:

Re: iOS 13 gyroscope changes

Post by edgar_ali » Fri Sep 27, 2019 4:47 am

shouldn't this be integrated into the skin element (gyroscope) by ggnome???

KMiddelkoop
Posts: 7
Joined: Thu May 30, 2019 1:47 pm

Re: iOS 13 gyroscope changes

Post by KMiddelkoop » Fri Sep 27, 2019 8:43 pm

That would be great, I hope Hopki is on it.

User avatar
thomas
Chief Gnome
Posts: 2537
Joined: Fri Sep 01, 2006 3:56 pm
Location: Vienna, Austria
Contact:

Re: iOS 13 gyroscope changes

Post by thomas » Fri Sep 27, 2019 11:23 pm

The next update will solve this directly in the Pano2VR player.
MfG, Thomas

Jmondo
Posts: 33
Joined: Thu Nov 16, 2017 11:10 am

Re: iOS 13 gyroscope changes

Post by Jmondo » Sat Sep 28, 2019 4:05 pm

Thanks Thomas!

Jmondo
Posts: 33
Joined: Thu Nov 16, 2017 11:10 am

Re: iOS 13 gyroscope changes

Post by Jmondo » Wed Oct 02, 2019 1:52 pm

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: 2537
Joined: Fri Sep 01, 2006 3:56 pm
Location: Vienna, Austria
Contact:

Re: iOS 13 gyroscope changes

Post by thomas » Wed Oct 02, 2019 2:20 pm

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

Re: iOS 13 gyroscope changes

Post by Jmondo » Wed Oct 02, 2019 3:03 pm

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

Re: iOS 13 gyroscope changes

Post by Jmondo » Wed Oct 02, 2019 3:08 pm

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: 13
Joined: Mon Mar 30, 2009 5:18 am

Re: iOS 13 gyroscope changes

Post by Jeffreycb » Thu Oct 03, 2019 8:29 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: 9595
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Re: iOS 13 gyroscope changes

Post by Hopki » Thu Oct 03, 2019 5:09 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests