Skip to content

Instantly share code, notes, and snippets.

@leifwells
Last active June 4, 2016 14:49
Show Gist options
  • Save leifwells/302c04f99751e54b3bd92108a7fee065 to your computer and use it in GitHub Desktop.
Save leifwells/302c04f99751e54b3bd92108a7fee065 to your computer and use it in GitHub Desktop.
Ionic 1: Setting a Local Notification with Sound
$cordovaLocalNotification.schedule({
id: note.id, // Number, used as unique identifier
at: note.at, // Date or Number, time
text: note.text, // String, 1st row of notification
title: note.title, // String, 2nd row of the notification
sound: 'res://platform_default',// Uri, path to sound file
badge: 1, // Number, appear on app icon
data: 'hello=world' // String, objects as encoded JSON
}).then(function ( result ) {
console.log(note.title + ' Notification Set');
}, function ( error ) {
console.log( 'setUpNotification ERROR: ' + error );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment