Shake

Contents

Handles shake gesture

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

Ionic 摇一摇 Shake插件的安装(Installation)

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

Ionic 摇一摇 Shake插件支持的平台(Supported Platforms)

  • iOS

Ionic 摇一摇 Shake插件的用法(Usage)

import { Shake } from '@ionic-native/shake';

constructor(private shake: Shake) { }

...

const watch = this.shake.startWatch(60).subscribe(() => {
  // do something
  });

watch.unsubscribe();