aframe icon indicating copy to clipboard operation
aframe copied to clipboard

VR mode on iOS 13.4.1 does not work

Open dax72 opened this issue 6 years ago • 40 comments

Gyroscope movement does not work, it works fine before ios13.4.1 update or without turning on vr mode.

  • A-Frame Version: 1.04
  • Platform / Device: IOS 13.4.1 - iPhone and iPad

dax72 avatar Apr 14 '20 21:04 dax72

Hi, can you try the branch in PR #4548 and see if that fixes it?

machenmusik avatar Apr 14 '20 23:04 machenmusik

is there a dist ready to download?

dax72 avatar Apr 15 '20 07:04 dax72

I couldn't find any relevant changes on the Safari release notes:

https://developer.apple.com/documentation/safari_release_notes

dmarcos avatar Apr 15 '20 21:04 dmarcos

I just tried on another iPad (iPad Pro 12,9""), v13.4.1...same problem! Motion sensor does not work when you click VR button.

dax72 avatar Apr 15 '20 22:04 dax72

We should probably disable cardboard / stereo mode on iPads

dmarcos avatar Apr 15 '20 22:04 dmarcos

and on iPhone? currently I can confirm that it does not work on iPhone and iPad with iOS13.4.1. VR mode on iPad has no sense..but on iPhone it's necessary

dax72 avatar Apr 15 '20 22:04 dax72

Got same issue, with my older iphone for tests with iOS 13.3 it does work properly, but newest 13.4.X it doesn't... as far as i checked DeviceMotionEvent.requestPermission() doesn't seem to work right, it asks about permission, right after with my app it reloads page and and my typical promise that checks if it's gyroscope or if the device support gyroscope it saying "false" for iPhone with newest iOS :/ previous version was ok.

Also checked with DeviceOrientationEvent, doesn't help :(

kowalus23 avatar Apr 15 '20 22:04 kowalus23

On iPad we can disable. On iPhone we can keep for now. What’s your audience? Can you share details on your application? We see Cardboard usage decline and harder and harder to come by. Polyfilled VR comes with a lot of issues like this one where things break when browser APIs and policies change.

dmarcos avatar Apr 15 '20 22:04 dmarcos

We create VR games/apps for clients and they require iPhone compatibility

dax72 avatar Apr 15 '20 23:04 dax72

Is iPhone compatibility via Magic Window mode enough? Do you have any metrics of cardboard usage you can share?

dmarcos avatar Apr 15 '20 23:04 dmarcos

Magic Window mode it's not enough, they need stereo mode. I think the percentage of iPhone/cardboard is not relevant but clients require the compatibility iPhone/android and without it they do not market products.

Safari iOS from a development point of view is a nightmare because there is no webVR/webXR support but for big companies it is not their problem, they want it to work on iOS too :(

dax72 avatar Apr 16 '20 07:04 dax72

@dax72 Thanks for the info. Is your client decision based on any audience metrics?

dmarcos avatar Apr 16 '20 15:04 dmarcos

@dmarcos Unfortunately I don't have access to their audience metrics, but I have more clients that are asking to me to fix this iOS bug

dax72 avatar Apr 16 '20 18:04 dax72

@dax72 Are they willing to pay to fix the issue?

dmarcos avatar Apr 16 '20 18:04 dmarcos

For what it's worth, this also affects magic window tracking, not just VR mode.

andreyrd avatar Apr 18 '20 17:04 andreyrd

Ok, did some investigating. 🕵🏻‍♂️

This was a regression in Webkit, reported on 2020-03-31: https://bugs.webkit.org/show_bug.cgi?id=209831 And patched same day by the reporter: https://github.com/WebKit/webkit/commit/13e78b2bad4fb6f8c8a152e9a3cfc07c910dc858

Unfortunately, considering that the changeset which introduced the bug was in December 2019: https://trac.webkit.org/changeset/253357/webkit And the bug only showed up just now in 13.4.1, it seems it's gonna take a really long time to see the patch fixing it make it's way into iOS.

andreyrd avatar Apr 18 '20 17:04 andreyrd

Thanks for investigating. Super appreciated. Magic window still works for me on examples:

https://aframe.io/aframe/examples/

it’s a different code path

dmarcos avatar Apr 18 '20 18:04 dmarcos

Oh, interesting! That's probably because our team is currently stuck on 0.9.2 for other reasons, which is using the webvr-polyfill / device motion api for magic window?

So scratch that. Can confirm that on latest aframe, magic window is fine.

andreyrd avatar Apr 18 '20 18:04 andreyrd

Since iOS 13, Safari requires permission to access DeviceMotion. 0.9.2 doesn’t have the request logic. It predates iOS 13

dmarcos avatar Apr 18 '20 18:04 dmarcos

Yeah, we manually call DeviceMotionEvent.requestPermission(). Worked up until this bug. Same issue as VR mode in latest versions, lots of log spam TypeError: null is not an object (evaluating 'i.alpha') from webvr-polyfill.

andreyrd avatar Apr 18 '20 18:04 andreyrd