How to set vibration for local notification using ionic & cordova?

Could anyone tell how to set vibration for local notification in every notification i want to get vibrate in my mobile.

Local Notification Sample Code:

  id    : remId,
  title : name.innerHTML,
  text  : note.value,                
  at    : alertDate              

Vibrate Code:


Please help me… if is it possible, please give me a good solution.

Thank You!

How about playing sound?, please update if you have found a solutions

Hi ,

I was fiddling with this stuff and have some solutions .

for the vibration part :
Try using cordova vibration plugin that you have used already.
and call this vibration code from with the event that is raised as a result of notification:

cordova.plugins.notification.local.on(“trigger”, function(notification) {

you can play sound by following this syntax:

icon: “res://icon”,
text:“blah blah.”

using this syntax make sure that you keep the file within www folder at the same hirarchy as js or img

let me know if it works.



hi, Thanks for your response…! :smile:

Hi @indrajit87, i tried what you did but it didn’t work.

I downloaded the plugin and localnotification, tried the example there was given.

here is what I did.

id: 1,
text: ‘Hello World’,
every: ‘minute’
}).then(function (result) {
id: 1,
badge: counter,

I checked my phone setting and even tried the navigator.vibration(time) as well. Have i missed something?


nvm, I got it. It was my setting, I need to turn it on to get the vibration to work.