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

Commit

Permalink
Issue #12: Handling multiple notifications on Android devices
Browse files Browse the repository at this point in the history
Issue #12: update support jar
Issue #12: Updated docs
  • Loading branch information
macdonst committed Jul 10, 2015
1 parent cab9553 commit 04705bf
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 2 deletions.
51 changes: 50 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ phonegap plugin add https://github.com/phonegap/phonegap-plugin-push

## Quick Example

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

Expand Down Expand Up @@ -55,6 +55,11 @@ phonegap plugin add https://github.com/phonegap/phonegap-plugin-push
Parameter | Description
--------- | ------------
`options` | `JSON Object` platform specific initialization options.
`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.

#### Returns

Expand Down Expand Up @@ -152,6 +157,50 @@ The `count` is an integer indicating what number should show up in the badge. Pa
push.setApplicationIconBadgeNumber(successHandler, errorHandler, count);
```

## Android Behaviour

By default when using this plugin on Android each notification that your app receives will replace the previous notification in the shade.

If you want to see multiple notifications in the shade you will need to provide a notification ID as part of the push data sent to the app. For instance if you send:

```
{
title: "Test Push",
message: "Push number 1"
}
```

Followed by:

```
{
title: "Test Push",
message: "Push number 2"
}
```

You will only see "Push number 2" in the shade. However, if you send:

```
{
title: "Test Push",
message: "Push number 1",
nodId: 1
}
```

and:

```
{
title: "Test Push",
message: "Push number 2",
nodId: 2
}
```

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

## Native Requirements

- There should be no dependency on any other plugins.
Expand Down
2 changes: 1 addition & 1 deletion src/android/com/adobe/phonegap/push/GCMIntentService.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,4 @@ public void onError(Context context, String errorId) {
Log.e(LOG_TAG, "onError - errorId: " + errorId);
}

}
}
Binary file modified src/android/libs/android-support-v13.jar
Binary file not shown.

0 comments on commit 04705bf

Please sign in to comment.