mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
23 lines
454 B
TypeScript
23 lines
454 B
TypeScript
import * as Rx from 'rx';
|
|
|
|
import * as util from 'ionic/util';
|
|
import {NativePlugin} from '../plugin';
|
|
|
|
@NativePlugin({
|
|
name: 'Vibration',
|
|
platforms: ['ios', 'android', 'web'],
|
|
engines: {
|
|
cordova: 'cordova-plugin-vibration'
|
|
}
|
|
})
|
|
export class Vibration {
|
|
static vibrate(pattern) {
|
|
if(!navigator.vibrate) {
|
|
this.pluginWarn();
|
|
console.log('Vibrate (dev): ', pattern);
|
|
} else {
|
|
navigator.vibrate(pattern);
|
|
}
|
|
}
|
|
}
|