[expo-sensors] DeviceMotion / Gyroscope not working

Please provide the following:

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


I’ve installed the expo-sensors package and tried to use both DeviceMotion and Gyroscope.

With both, I get isAvailable resolved to true by calling .isAvailableAsync, but the event listenter will never be triggered.

Example code (result ist the same for both DeviceMotion and Gyroscope). data will always stay null.

  const [data, setData] = useState(null)
  useEffect(() => {
    (async () => {
      const isAvailable = await DeviceMotion.isAvailableAsync()
      if(isAvailable) {
        const subscription = DeviceMotion.addListener((data) => {
        return subscription.remove()
  }, [])

Thanks for your help,

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