Commit b095a550 authored by Sebastián Katzer's avatar Sebastián Katzer
Browse files

Update README.md

parent ea3b9d6a
Loading
Loading
Loading
Loading
+14 −9
Changes for README.md: 14 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -9,6 +9,9 @@ by Sebastián Katzer ([github.com/katzer](https://github.com/katzer))
- **iOS**<br>
See [Local and Push Notification Programming Guide](http://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/WhatAreRemoteNotif.html) for detailed informations and screenshots.

- **Android**<br>
See [Notification Guide](http://developer.android.com/guide/topics/ui/notifiers/notifications.html) for detailed informations and screenshots.

## Adding the Plugin to your project
Through the [Command-line Interface](http://cordova.apache.org/docs/en/3.0.0/guide_cli_index.md.html#The%20Command-line%20Interface):
```
@@ -22,23 +25,25 @@ cordova plugin rm de.appplant.cordova.plugin.local-notifications
```

## Release Notes
#### Version 0.4.0 (not yet released)
- Added Android support<br>
  *Based on the LocalNotifications Android plugin made by* ***Daniël (dvtoever)***

#### Version 0.2.0 (11.08.2013)
- Added iOS support<br>
  *Based on the LocalNotifications iOS plugin made by* ***Rodrigo Moyle***

## Using the plugin
The plugin creates the object ```window.plugin.notification.local``` with three methods:
The plugin creates the object ```window.plugin.notification.local``` with the following methods:

### add()
All settings are optional. If no date object is given, the notification will popup immediately.

To add a custom notification:
The method allows to add a custom notification. It takes an hash as an argument to specify the notification's properties. All properties are optional. If no date object is given, the notification will popup immediately.
```javascript
window.plugin.notification.local.add({
    date: date, // this expects a date object
    message: message, // the message that is displayed
    repeat: repeat, // has the options of 'weekly','daily','monthly','yearly')
    badge: badge, // (only iOS) displays number badge to notification
    repeat: repeat, // has the options of daily', 'weekly',''monthly','yearly')
    badge: badge, // displays number badge to notification
    foreground: forground, // a javascript function to be called if the app is running
    background: background, // a javascript function to be called if the app is in the background
    sound: sound // (only iOS) a sound to be played, the sound must be located in your project's resources and must be a caf file
@@ -46,18 +51,18 @@ window.plugin.notification.local.add({
```

### cancel()
To cancel a specific notification:
The method cancels a notification which was previously added. It takes the ID of the notification as an argument.
```javascript
window.plugin.notification.local.cancel(__id__);
```

### cancelAll()
To cancel all notifications:
The method cancels all notifications which were previously added by the application.
```javascript
window.plugin.notification.local.cancelAll();
```

#### Example
## Example
```javascript
var now                  = new Date().getTime(),
    _60_seconds_from_now = new Date(now + 60*1000);