Apache Cordova / PhoneGap Plugin to detect when a physical device performs a shake gesture.
This is based on a standalone JavaScript implementation I wrote last year (gist).
cordova plugin add https://github.com/leecrossley/cordova-plugin-shake-detection.git
You do not need to reference any JavaScript, the Cordova plugin architecture will add a shake object to your root automatically when you build.
NB: There is no native component to this plugin.
var onShake = function () {
// Code fired when a shake is detected
};
// Start watching for shake gestures and call "onShake"
shake.startWatch(onShake);
// Stop watching for shake gestures
shake.stopWatch();