Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

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

$
0
0

Hi ,

I was fiddling with this stuff and have some solutions .

@praveenjp
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) {
$cordovaVibration.vibrate(200);
});

@samdeniyi
you can play sound by following this syntax:

$cordovaLocalNotification.schedule({
id:1234,
title:"Stretch!",
at:trigger_time,
sound:"file://alert_android.mp3",
icon: "res://icon",
smallIcon:"res://ic_stat_stretch",
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.

regards,
Indrajit


Viewing all articles
Browse latest Browse all 228595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>