Shake

Improve this doc

$ ionic plugin add cordova-plugin-shake
$ npm install --save @ionic-native/shake

Repo: https://github.com/leecrossley/cordova-plugin-shake

Handles shake gesture

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>

API

Native

General