mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-24 06:01:18 +08:00
parent
8cd6686803
commit
203d4c7669
@ -69,6 +69,7 @@ import {Push} from './plugins/push';
|
|||||||
import {SafariViewController} from './plugins/safari-view-controller';
|
import {SafariViewController} from './plugins/safari-view-controller';
|
||||||
import {Screenshot} from './plugins/screenshot';
|
import {Screenshot} from './plugins/screenshot';
|
||||||
import {SecureStorage} from './plugins/securestorage';
|
import {SecureStorage} from './plugins/securestorage';
|
||||||
|
import {Shake} from './plugins/shake';
|
||||||
import {Sim} from './plugins/sim';
|
import {Sim} from './plugins/sim';
|
||||||
import {SMS} from './plugins/sms';
|
import {SMS} from './plugins/sms';
|
||||||
import {SocialSharing} from './plugins/socialsharing';
|
import {SocialSharing} from './plugins/socialsharing';
|
||||||
@ -156,6 +157,7 @@ export {
|
|||||||
PinDialog,
|
PinDialog,
|
||||||
Screenshot,
|
Screenshot,
|
||||||
SecureStorage,
|
SecureStorage,
|
||||||
|
Shake,
|
||||||
SocialSharing,
|
SocialSharing,
|
||||||
Sim,
|
Sim,
|
||||||
Splashscreen,
|
Splashscreen,
|
||||||
@ -234,6 +236,7 @@ window['IonicNative'] = {
|
|||||||
SafariViewController: SafariViewController,
|
SafariViewController: SafariViewController,
|
||||||
Screenshot: Screenshot,
|
Screenshot: Screenshot,
|
||||||
SecureStorage: SecureStorage,
|
SecureStorage: SecureStorage,
|
||||||
|
Shake: Shake,
|
||||||
Sim: Sim,
|
Sim: Sim,
|
||||||
SMS: SMS,
|
SMS: SMS,
|
||||||
SocialSharing: SocialSharing,
|
SocialSharing: SocialSharing,
|
||||||
|
35
src/plugins/shake.ts
Normal file
35
src/plugins/shake.ts
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
import {Plugin, Cordova} from './plugin';
|
||||||
|
import {Observable} from 'rxjs/Observable';
|
||||||
|
/**
|
||||||
|
* @name Shake
|
||||||
|
* @description Handles shake gesture
|
||||||
|
* @usage
|
||||||
|
* ```typescript
|
||||||
|
* import {Shake} from 'ionic-native';
|
||||||
|
*
|
||||||
|
* let watch = Shake.startWatch(60).subscribe(() => {
|
||||||
|
* // do something
|
||||||
|
* });
|
||||||
|
*
|
||||||
|
* watch.unsubscribe();
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
@Plugin({
|
||||||
|
plugin: 'cordova-plugin-shake',
|
||||||
|
pluginRef: 'shake',
|
||||||
|
repo: 'https://github.com/leecrossley/cordova-plugin-shake'
|
||||||
|
})
|
||||||
|
export class Shake {
|
||||||
|
/**
|
||||||
|
* Watch for shake gesture
|
||||||
|
* @param sensitivity {number} Optional sensitivity parameter. Defaults to 40
|
||||||
|
*/
|
||||||
|
@Cordova({
|
||||||
|
observable: true,
|
||||||
|
clearFunction: 'stopWatch',
|
||||||
|
successIndex: 0,
|
||||||
|
errorIndex: 2
|
||||||
|
})
|
||||||
|
static startWatch(sensitivity?: number): Observable<any> {return; }
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user