Closed confile closed 9 years ago
Do you have a sample project you can reference?
Closing due to inactivity
I've also experienced the double shake problem on Android. Here's a project that reproduces the issue, along with using debounce
to work around it - https://github.com/dandv/meteor-shake/blob/master/example/client/example.js#L6
Note that @alexgibson's shake.js (shake detection for mobile browsers using the devicemotion API) also handles this problem by using a timeout (defaulting to 1000ms).
I'm also running into this issue. For what it's worth, here is the code I'm using:
// Device Ready
document.addEventListener("deviceready", function() {
// http://plugreg.com/plugin/leecrossley/cordova-plugin-shake-detection
var onShake = function() {
console.log("Shake!");
nextLevel();
};
// Start watching for shake gestures and call "onShake"
// with a shake sensitivity of 40 (optional, default 30)
shake.startWatch(onShake, 30);
});
Shake event is fired twice every time it fires. Even increasing the sensitivity I was not able to reduce the number of times the shake method is called.
Whenever I shake my iPhone 5 iOS 7.2.2 the callback is called twice.