Last active
June 4, 2016 14:49
-
-
Save leifwells/302c04f99751e54b3bd92108a7fee065 to your computer and use it in GitHub Desktop.
Ionic 1: Setting a Local Notification with Sound
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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