Gyroscope implementation on mobile

Hi folks,

I need a working implementation to check out the gyroscope data on iOS and android.
Everything that I’ve found in the forum seems to be outdated and not working.
Can anybody post a solution, please?

Hi @pepone3d,

I am not aware of a Playcanvas example using that, but getting the device orientation is pretty straightforward using vanilla JS.

Check the following MDN article, it contains examples on how to access the gyro data:

Hi Leonidas,
thanks, I got it working. Unfortunately Apple did this: " With iOS 12.2, the company is introducing a new privacy setting called “Motion and Orientation Access” into version 12.1 of its browser, which will be disabled by default."

Is there a way to detect the iOS version and then ask for that specific permission?