Commit 0e4e2230 by Sebastián Katzer

Merge branch 'master' of github.com:katzer/cordova-plugin-local-notifications

parents 9b70ce86 1acb7ce9
...@@ -57,15 +57,14 @@ All properties are optional. If no date object is given, the notification will p ...@@ -57,15 +57,14 @@ All properties are optional. If no date object is given, the notification will p
```javascript ```javascript
window.plugin.notification.local.add({ window.plugin.notification.local.add({
id: id, // a unique id of the notifiction id: String, // a unique id of the notifiction
date: date, // this expects a date object date: Date, // this expects a date object
message: message, // the message that is displayed message: String, // the message that is displayed
title: title, // the title of the message title: String, // the title of the message
repeat: repeat, // has the options of daily', 'weekly',''monthly','yearly') repeat: String, // has the options of daily', 'weekly',''monthly','yearly')
badge: badge, // displays number badge to notification badge: Number, // displays number badge to notification
sound: sound // a sound to be played foreground: String, // a javascript function to be called if the app is running
foreground: forground, // a javascript function to be called if the app is running background: String, // a javascript function to be called if the app is in the background
background: background, // a javascript function to be called if the app is in the background
}); });
``` ```
...@@ -88,7 +87,7 @@ var now = new Date().getTime(), ...@@ -88,7 +87,7 @@ var now = new Date().getTime(),
_60_seconds_from_now = new Date(now + 60*1000); _60_seconds_from_now = new Date(now + 60*1000);
window.plugin.notification.local.add({ window.plugin.notification.local.add({
id: 1, id: 1, // is converted to a string
date: _60_seconds_from_now, date: _60_seconds_from_now,
message: 'Hello world!', message: 'Hello world!',
title: 'Check that out!', title: 'Check that out!',
...@@ -107,8 +106,8 @@ function background (id) { ...@@ -107,8 +106,8 @@ function background (id) {
``` ```
## Quirks ## Platform specifics
### How to specify the notification icon under Android ### Notification icon under Android
By default all notifications will display the app icon. But an specific icon can be defined through the `icon` property. By default all notifications will display the app icon. But an specific icon can be defined through the `icon` property.
```javascript ```javascript
/** /**
...@@ -132,11 +131,18 @@ window.plugin.notification.local.add({ sound: 'sub.caf' }); ...@@ -132,11 +131,18 @@ window.plugin.notification.local.add({ sound: 'sub.caf' });
### LiveTile background images under WP8 ### LiveTile background images under WP8
LiveTile's have the ability to display images for different sizes. These images can be defined through the `smallImage`, `image` and `wideImage` properties.<br> LiveTile's have the ability to display images for different sizes. These images can be defined through the `smallImage`, `image` and `wideImage` properties.<br>
An image must be defined as a relative or absolute URI. All images will be reseted by canceling the notification. An image must be defined as a relative or absolute URI.
```javascript ```javascript
/** /**
* Displays the application image as the livetile's background image * Displays the application icon as the livetile's background image
*/ */
window.plugin.notification.local.add({ image: 'appdata:ApplicationImage.png' }) window.plugin.notification.local.add({ image: 'appdata:ApplicationIcon.png' })
``` ```
All images can be restored to the default ones by canceling the notification.
## Quirks
### Adding a notification under WP8
An application can only display one notification at a time. Each time a new notification has to be added, the application live tile's data will be overwritten by the new ones.
### Canceling a notification under WP8
The methods `cancel` and `cancelAll` have the same effect.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment