Hi,
I just added vibration into my project. The code is below.
vibrate.html
<button ion-button color=“danger” round (click)=“vibrationBtn()”> Vibrate
vibrate.ts
import { Vibration } from ‘@ionic-native/vibration’;
vibrationBtn() {
this.vibration.vibrate(3000);
}
app.module.ts
import { Vibration } from ‘@ionic-native/vibration’;
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler},
TodoProvider,
Vibration
]
This is simple code and there is no error message.
I executed even on the android emulator, but I don’t hear any vibration sound. I don’t know what it wrongs.
I am using Ubuntu and ear phone in order to listen music.
Thank you in advance.