You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason (my guess is that it is due to not calibrating the sensor) phones running android > 12 the sensor accuracy comes back as SensorManager.SENSOR_STATUS_ACCURACY_LOW.
This causes the shake detection to not work in the shake plugin due to the check in onSensorChanged in AccelListener.java
The following change fixes the issue and shake detection is now working great for me on all phones.
Change the line in plugins/cordova-plugin-device-motion/src/android/AccelListener.java:
if (this.accuracy >= SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM) {
to
if (this.accuracy >= SensorManager.SENSOR_STATUS_ACCURACY_LOW) {
My guess is that while this works there is a better fix since the device-motion plugin is apparently depreciated.
The text was updated successfully, but these errors were encountered:
For some reason (my guess is that it is due to not calibrating the sensor) phones running android > 12 the sensor accuracy comes back as SensorManager.SENSOR_STATUS_ACCURACY_LOW.
This causes the shake detection to not work in the shake plugin due to the check in onSensorChanged in AccelListener.java
The following change fixes the issue and shake detection is now working great for me on all phones.
Change the line in plugins/cordova-plugin-device-motion/src/android/AccelListener.java:
if (this.accuracy >= SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM) {
to
if (this.accuracy >= SensorManager.SENSOR_STATUS_ACCURACY_LOW) {
My guess is that while this works there is a better fix since the device-motion plugin is apparently depreciated.
The text was updated successfully, but these errors were encountered: