Shake
Handles shake gesture
Repo: https://github.com/leecrossley/cordova-plugin-shake
Installation
- Install the Cordova and Ionic Native plugins:
$ ionic cordova plugin add cordova-plugin-shake $ npm install --save @ionic-native/shake@4
- Add this plugin to your app's module
Supported platforms
- iOS
Usage
import { Shake } from '@ionic-native/shake';
constructor(private shake: Shake) { }
...
const watch = this.shake.startWatch(60).subscribe(() => {
// do something
});
watch.unsubscribe();
Instance Members
startWatch(sensitivity)
Watch for shake gesture
Param | Type | Details |
---|---|---|
sensitivity |
number
|
Optional sensitivity parameter. Defaults to 40 |
Returns: Observable<any>