@@ -15,18 +15,18 @@ Local notifications are ideally suited for applications with time-based behavior
...
@@ -15,18 +15,18 @@ Local notifications are ideally suited for applications with time-based behavior
For example, applications that depend on servers for messages or data can poll their servers for incoming items while running in the background; if a message is ready to view or an update is ready to download, they can then present a local notification immediately to inform their users.
For example, applications that depend on servers for messages or data can poll their servers for incoming items while running in the background; if a message is ready to view or an update is ready to download, they can then present a local notification immediately to inform their users.
### Plugin's Purpose
### Plugin's Purpose
The purpose of the plugin is to create an platform independent javascript interface for [Cordova][cordova]based mobile applications to access the specific API on each platform.
The purpose of the plugin is to create a platform-independent javascript interface for [Cordova][cordova]-based mobile applications to access the specific API on each platform.
## Supported Platforms
## Supported Platforms
-**iOS** _(up to iOS8)_<br>
-**iOS** _(up to iOS8)_<br>
See [Local and Push Notification Programming Guide][ios_notification_guide] for detailed informations and screenshots.
See [Local and Push Notification Programming Guide][ios_notification_guide] for detailed information and screenshots.
-**Android***(SDK >=7)*<br>
-**Android***(SDK >=7)*<br>
See [Notification Guide][android_notification_guide] for detailed informations and screenshots.
See [Notification Guide][android_notification_guide] for detailed information and screenshots.
-**WP8**<br>
-**WP8**<br>
See [Local notifications for Windows Phone][wp8_notification_guide] for detailed informations and screenshots.
See [Local notifications for Windows Phone][wp8_notification_guide] for detailed information and screenshots.
<br>*Windows Phone 8.0 has no notification center. Instead local notifications are realized through live tiles updates.*
<br>*Windows Phone 8.0 has no notification center. Instead local notifications are realized through live tiles updates.*
More informations can be found [here][PGB_plugin].
More information can be found [here][PGB_plugin].
## ChangeLog
## ChangeLog
...
@@ -80,7 +80,7 @@ More informations can be found [here][PGB_plugin].
...
@@ -80,7 +80,7 @@ More informations can be found [here][PGB_plugin].
-[enhancement:] Callbacks for `add`, `cancel` & `cancelAll`
-[enhancement:] Callbacks for `add`, `cancel` & `cancelAll`
-[enhancement:]`image:` accepts remote URLs and local URIs (Android)
-[enhancement:]`image:` accepts remote URLs and local URIs (Android)
#### Further informations
#### Further information
- See [CHANGELOG.md][changelog] to get the full changelog for the plugin.
- See [CHANGELOG.md][changelog] to get the full changelog for the plugin.
- See the [v0.8.x TODO List][todo_list] for upcomming changes and other things.
- See the [v0.8.x TODO List][todo_list] for upcomming changes and other things.
...
@@ -113,11 +113,11 @@ document.addEventListener('deviceready', function () {
...
@@ -113,11 +113,11 @@ document.addEventListener('deviceready', function () {
```
```
### Determine if the app does have the permission to show local notifications
### Determine if the app does have the permission to show local notifications
If the permission has been granted through the user can be retrieved through the `notification.local.hasPermission` interface.<br/>
If the permission has been granted through the user it can be retrieved through the `notification.local.hasPermission` interface.<br/>
The method takes a callback function as its argument which will be called with a boolean value. Optional the scope of the callback function ca be defined through a second argument.
The method takes a callback function as its argument which will be called with a boolean value. Optional: the scope of the callback function can be defined through a second argument.
#### Further informations
#### Further information
- The method is supported on each platform, however its only relevant for iOS8 and above.
- The method is supported on each platform, however it's only relevant for iOS8 and above.
Required permissions can be registered through the `notification.local.registerPermission` interface.<br/>
Required permissions can be registered through the `notification.local.registerPermission` interface.<br/>
The method takes a callback function as its argument which will be called with a boolean value. Optional the scope of the callback function ca be defined through a second argument.
The method takes a callback function as its argument which will be called with a boolean value. Optional: the scope of the callback function can be defined through a second argument.
#### Further informations
#### Further information
- The method is supported on each platform, however its only relevant for iOS8 and above.
- The method is supported on each platform, however its only relevant for iOS8 and above.
- The user will only get a prompt dialog for the first time. Later its only possible to change the setting via the notification center.
- The user will only get a prompt dialog for the first time. Later it's only possible to change the setting via the notification center.
### Check wether a notification with an ID is scheduled
### Check whether a notification with an ID is scheduled
To check if a notification with an ID is scheduled, the `notification.local.isScheduled` interface can be used.<br>
To check if a notification with an ID is scheduled, the `notification.local.isScheduled` interface can be used.<br>
The method takes the ID of the local notification as an argument and a callback function to be called with the result. Optional the scope of the callback can be assigned too.
The method takes the ID of the local notification as an argument and a callback function to be called with the result. Optional: the scope of the callback can be assigned too.
#### Further informations
#### Further information
- See [getScheduledIds][getscheduledids]of how to retrieve a list of IDs of all scheduled local notifications.
- See [getScheduledIds][getscheduledids]to retrieve a list of IDs for all scheduled local notifications.
### Check wether a notification with an ID was triggered
### Check whether a notification with an ID was triggered
To check if a notification with an ID was triggered, the `notification.local.isTriggered` interface can be used.<br>
To check if a notification with an ID was triggered, the `notification.local.isTriggered` interface can be used.<br>
The method takes the ID of the local notification as an argument and a callback function to be called with the result. Optional the scope of the callback can be assigned too.
The method takes the ID of the local notification as an argument and a callback function to be called with the result. Optional: the scope of the callback can be assigned too.
#### Further informations
#### Further information
- See [getTriggeredIds][gettriggeredIds]of how to retrieve a list of IDs of all scheduled local notifications.
- See [getTriggeredIds][gettriggeredIds]to retrieve a list of IDs for all scheduled local notifications.
The default values of the local notification properties can be set through the `notification.local.setDefaults` interface.<br>
The default values of the local notification properties can be set through the `notification.local.setDefaults` interface.<br>
The method takes an object as argument.
The method takes an object as argument.
#### Further informations
#### Further information
- See the [add][add] interface and the [platform specific properties][platform_specific_properties] to get an overview about all available local notification properties.
- See the [add][add] interface and the [platform specific properties][platform_specific_properties] to get an overview about all available local notification properties.
- See the [example][setdefaults_example]of how to override default values.
- See the [example][setdefaults_example] to override default values.
You can package the audio data in an *aiff*, *wav*, or *caf* file. Then, in Xcode, add the sound file to your project as a nonlocalized resource of the application bundle. You may use the *afconvert* tool to convert sounds.
You can package the audio data in an *aiff*, *wav*, or *caf* file. Then, in Xcode, add the sound file to your project as a nonlocalized resource of the application bundle. You may use the *afconvert* tool to convert sounds.
**Note:** The right to play notification sounds in the notification center settings has to be granted.<br>
**Note:** To play notification sounds, permission needs to be granted in the notification center settings.<br>
**Note:** Custom sounds must be under 30 seconds when played. If a custom sound is over that limit, the default system sound is played instead.
**Note:** Custom sounds must be under 30 seconds when played. If a custom sound is over that limit, the default system sound is played instead.
```javascript
```javascript
/**
/**
* Plays the `beep.mp3` which has to be located in the root folder of the project
* Plays the `beep.mp3` which must be located in the root folder of the project
LiveTile's have the ability to display images for different sizes. These images can be defined through the `smallImage`, `image` and `wideImage` properties.
LiveTiles have the ability to display images for different sizes. These images can be defined through the `smallImage`, `image` and `wideImage` properties.
**Note:** An image must be defined as a relative or absolute URI. They can be restored to the default ones by canceling the notification.
**Note:** An image must be defined as a relative or absolute URI. They can be restored to default by cancelling the notification.
```javascript
```javascript
/**
/**
* Displays the application icon as the livetile's background image
* Displays the application icon as the LiveTile's background image
The LED color can be specified through the `led` property. By default the color value is white (FFFFFF). Its possible to change that value by setting another hex code.
The LED color can be specified through the `led` property. By default the color value is white (FFFFFF). It is possible to change that value by setting another hex code.
@@ -505,16 +505,16 @@ Each application on a device is limited to 64 scheduled local notifications.<br>
...
@@ -505,16 +505,16 @@ Each application on a device is limited to 64 scheduled local notifications.<br>
The system discards scheduled notifications in excess of this limit, keeping only the 64 notifications that will fire the soonest. Recurring notifications are treated as a single notification.
The system discards scheduled notifications in excess of this limit, keeping only the 64 notifications that will fire the soonest. Recurring notifications are treated as a single notification.
### Events aren't fired on iOS
### Events aren't fired on iOS
After deploying/replacing the app on the device via Xcode no callback for previously scheduled local notifications aren't fired.
After deploying/replacing the app on the device via Xcode, no callback for previously scheduled local notifications are fired.
### No sound is played on iOS 7
### No sound is played on iOS 7
The right to play notification sounds in the notification center settings has to be granted.
Users must grant permission in the notification center settings for notification sounds to be played.
### Adding a notification on WP8
### Adding a notification on 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.
An application can only display one notification at a time. Each time a new notification is added, the application's LiveTile data will be overwritten by the new ones.
### TypeError: Cannot read property 'currentVersion' of null
### TypeError: Cannot read property 'currentVersion' of null
Along with Cordova 3.2 and Windows Phone 8 the `version.bat` script has to be renamed to `version`.
Along with Cordova 3.2 and Windows Phone 8, the `version.bat` script must be renamed to `version`.
On Mac or Linux
On Mac or Linux
```
```
...
@@ -531,6 +531,8 @@ The launch mode for the main activity has to be set to `singleInstance`
...
@@ -531,6 +531,8 @@ The launch mode for the main activity has to be set to `singleInstance`
### A notification cleared by the User is still shown as Triggered on Android
It is not possible on Android to listen for an application notification to be cleared by the user. Currently, the only way to prevent that sort of behavior is to set the "ongoing" parameter to "true" and cancel the notification during the onclick event.