Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
Updating Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Raghav Katyal committed Jul 11, 2015
1 parent 04705bf commit 60d2e73
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,13 @@ phonegap plugin add https://github.com/phonegap/phonegap-plugin-push

- Android
- iOS

## Platforms Under Development

- WP8
- Windows Universal

## Quick Example

```javascript
var push = PushNotification.init({ "android": {"senderID": "12345679"},
"ios": {}, "wp": {"channelName": "12345679"} } );
"ios": {}, "windows": {} } );

push.on('registration', function(data) {
// data.registrationId
Expand All @@ -40,6 +37,7 @@ phonegap plugin add https://github.com/phonegap/phonegap-plugin-push
// data.title,
// data.count,
// data.sound,
// data.image,
// data.additionalData
});

Expand All @@ -58,8 +56,7 @@ Parameter | Description
`options.android` | `JSON Object` Android specific initialization options.
`options.android.senderID` | `String` Maps to the project number in the Google Developer Console.
`options.ios` | `JSON Object` iOS specific initialization options.
`options.wp` | `JSON Object` Windows specific initialization options.
`options.wp.channelName` | `String` Channel URI from Microsoft.
`options.windows` | `JSON Object` Windows specific initialization options.

#### Returns

Expand All @@ -69,7 +66,7 @@ Parameter | Description

```javascript
var push = PushNotification.init({ "android": {"senderID": "12345679"},
"ios": {}, "wp": {"channelName": "12345679"} } );
"ios": {}, "windows": {} } );
```

### push.on(event, callback)
Expand Down Expand Up @@ -103,8 +100,9 @@ Callback Parameter | Description
------------------ | -----------
`data.message` | `String` The text of the push message sent from the 3rd party service.
`data.title` | `String` The optional title of the push message sent from the 3rd party service.
`data.count` | `Integer` The number of messages to be displayed in the badge iOS or message count in the notification shade in Android.
`data.count` | `String` The number of messages to be displayed in the badge iOS or message count in the notification shade in Android. For windows, it represents the value in the badge notification which could be a number or a status glyph.
`data.sound` | `String` The name of the sound file to be played upon receipt of the notification.
`data.image (windows only)` | `String` The path of the image file to be displayed in the notification.
`data.additionalData` | `JSON Object` An optional collection of data sent by the 3rd party push service that does not fit in the above properties.

#### Example
Expand All @@ -115,6 +113,7 @@ Callback Parameter | Description
// data.title,
// data.count,
// data.sound,
// data.image,
// data.additionalData
});
```
Expand Down Expand Up @@ -201,6 +200,14 @@ and:

You will only see both "Push number 1" and "Push number 2" in the shade.

## Windows Notifications

The plugin supports all types of windows platform notifications namely Tile, Toast, Badge and Raw. The API supports the basic cases of the notification templates with title corresponding to the first text element and message corresponding to the second if title is present else the first one. The image corresponds to the first image element of the notification xml.

The count is present only for the badge notification in which it represent the value of the notification which could be a number from 0-99 or a status glyph.

For advanced templates and usage, the notification object is included in data.additionalData.pushNotificationReceivedEventArgs.

This comment has been minimized.

Copy link
@nikhilkh

nikhilkh Jul 14, 2015

In markdown, it is common to use keyword for referencing names of types etc. For example, data.additionalData.pushNotificationReceivedEventArgs.

This comment has been minimized.

Copy link
@nikhilkh

nikhilkh Jul 14, 2015

It would be a good idea to get a link to the MSDN docs for this object.


## Native Requirements

- There should be no dependency on any other plugins.
Expand Down

0 comments on commit 60d2e73

Please sign in to comment.