Skip to content
This repository was archived by the owner on Mar 3, 2020. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,16 @@ To get started on Android, add the following to your gradle dependencies:
compile 'com.facebook.android:notifications:1.+'
```

After you've added the dependency, you'll have to [set up a GCM listener service](https://developers.google.com/cloud-messaging/android/client), and add the following to your service:
After you've added the dependency, you'll have to [set up an FCM listener service](https://firebase.google.com/docs/cloud-messaging/android/client), and add the following to your service:

```java
@Override
public void onMessageReceived(String from, final Bundle data) {
public void onMessageReceived(RemoteMessage remoteMessage) {
Bundle data = new Bundle();
for (Map.Entry<String, String> entry : remoteMessage.getData().entrySet()) {
data.putString(entry.getKey(), entry.getValue());
}

NotificationsManager.presentNotification(
this,
data,
Expand Down