Skip to content

Cordova / PhoneGap Plugin to detect when a physical device performs a shake gesture

Notifications You must be signed in to change notification settings

gabeboning/cordova-plugin-shake-detection

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Shake Gesture Detection for Cordova / PhoneGap

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).

1 step install

cordova plugin add https://github.com/leecrossley/cordova-plugin-shake-detection.git

Usage

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.

Example

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();

License

MIT License

About

Cordova / PhoneGap Plugin to detect when a physical device performs a shake gesture

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%