Hi friend! Meet us at App.js Conf in Krakow, Poland on April 4th and 5th with workshops and talks. Learn more
Gyroscope
Access the device gyroscope sensor to respond to changes in rotation in 3d space.
Expo.Gyroscope.addListener(listener)
Subscribe for updates to the gyroscope.
Arguments
listener (function) -- A callback that is invoked when an gyroscope update is available. When invoked, the listener is provided a single argumument that is an object containing keys x, y, z.
Returns
An EventSubscription object that you can call remove() on when you would like to unsubscribe the listener.
Expo.Gyroscope.removeAllListeners()
Remove all listeners.
Expo.Gyroscope.setUpdateInterval(intervalMs)
Subscribe for updates to the gyroscope.
Arguments
intervalMs (number) -- Desired interval in milliseconds between gyroscope updates.