DeviceMotion permission iOS13

Please provide the following:

  1. SDK Version: SDK35
  2. Platforms(Android/iOS/web/all): iOS13

Hi everyone,

I’m working on an VR app using Expo and a-frame with a webview. Everything worked well with iOS12 but I have some problems since I updated to iOS13 and SDK35. When I start the webview, it is impossible to use the VR mode, the scene can only be moved if the user is swiping the screen.

After some research, I found that iOS13 requires an user gesture for using the device motion:
https://github.com/aframevr/aframe/issues/4277

I looked in the Expo doc but the Permissions doesn’t seem to handle the DeviceMotion permission (and the DeviceMotion page only says we can check if it’s enabled or not). Is there any way to solve this ?

Thanks in advance

are you using expo-device-motion inside of the webview? if not, how are you interacting with the DeviceMotion API? no permissions are required for native usage on ios or android, but it seems that if you are doing this inside of a webview you are most likely dealing with the web standard api and not the expo api: DeviceMotionEvent - Web APIs | MDN

Hi adamjnav,

I tried to use the DeviceMotion API from expo-sensors to see if it’s working on iOS13. Indeed it seems to be working without permission because it returns me values like this

Object {
“acceleration”: Object {
“x”: -0.006262082723070828,
“y”: 0.009214865084016921,
“z”: 0.08704341009052996,
},
“accelerationIncludingGravity”: Object {
“x”: -0.0032933021738490997,
“y”: -0.07648664550197104,
“z”: -9.722582202986814,
},
“orientation”: 90,
“rotation”: Object {
“alpha”: -0.0000013219756100626566,
“beta”: 0.00873624887092809,
“gamma”: 0.0003026395363290025,
},
“rotationRate”: Object {
“alpha”: 0.0012765564024448395,
“beta”: 0.0005186367779970169,
“gamma”: -0.00007575028575956821,
},
}

But still, the VR still isn’t working and never used expo-device-motion or expo-sensors before because everything worked fine on sdk33 and ios12 and still working on Android.
If I’m interacting with the web standard api and not the expo, is there any way to solve it with expo ?

Thanks in advance

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.