I'm running Cordova on Android and this is my config files.
config.xml
<feature name="Vibration">
<param name="android-package" value="org.apache.cordova.vibration.Vibration" />
</feature>
<feature name="Media">
<plugin name="Media" value="org.apache.cordova.AudioHandler" />
</feature>
<feature name="Notification">
<param name="android-package" value="org.apache.cordova.Notification" />
</feature>
AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
my js
navigator.vibrate(1000);
I use normal jQuery (Not jQueryMobile) to run with cordova.
Vibration plugin as already installed by command line from this page (plugin git).
But vibration is not working.
I know this is an old thread, but, when testing on a device, be sure that the device is un-muted. Many (most) devices will "mute" the vibration as well as the audio. If you are debugging in the browser, you should see 'Vibrating for 1000ms.' in the console, which tells you the plugin is working (obviously you can't vibrate your computer). But, again, when testing on a device, be sure it's not on mute.
navigator.notification.vibrate(1000)
? (it's supposed to be deprecated but it's working for me)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With