网易云

Ionic实战视频教程(跨平台): https://www.itying.com/goods-1067.html

Flutter实战视频教程(跨平台): https://www.itying.com/goods-1176.html

Shake

Contents

Handles shake gesture

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

联系我们?

If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic's experts offer official maintenance, support, and integration help.

Contact Us Today!

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

ionic cordova plugin add cordova-plugin-shake npm install @ionic-native/shake
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More or Contact Us
ionic enterprise register --key=YOURPRODUCTKEY npm install @ionic-enterprise/shake

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

  • iOS

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

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

constructor(private shake: Shake) { }

...

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

watch.unsubscribe();