DeviceMotion rotation object

Hi ,

I am using DeviceMotion to check rotation of mobile but it is not returning ‘rotation’ object inside listener in mobile Moto G4 Plus and in some device it gives.

Please a way to solve this, as i want to know the device rotation around which side it rotates based on which i want my app to perform accordingly.

Hi @sreeram123. We’re forwarding whatever the Android OS sends to us, so that device might not be sending rotation events. If you want to try debugging this yourself you could look at DeviceMotionModule.java and try to figure out why those events aren’t happening.

@jesse: Is there any other way by which i can check on which direction device rotates in expo which works fine on all devices ?

We’re just relaying what the OS tells us, so I’m not sure why it’s not working. I don’t have a Moto G4 Plus to test on so it’d be useful if you could try debugging it.

@jesse:- Yes surely, i will check, in the mean time can you please let me know whether by any other means apart from using DeviceMotion i can get the motion of device ?

No, I’m not aware of any other way.

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