Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {

dependencies {
compile 'com.facebook.react:react-native:0.20.+'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.pusher:push-notifications-android:1.0.2'
implementation 'com.pusher:push-notifications-android:1.4.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.pusher.pushnotifications.SubscriptionsChangedListener;
import com.pusher.pushnotifications.PushNotificationReceivedListener;

import java.util.Map;
//
// TODO: verify the android manifest after https://docs.pusher.com/beams/reference/android
/**
Expand Down Expand Up @@ -68,7 +69,15 @@ public void onMessageReceived(RemoteMessage remoteMessage) {
map.putString("click_action", notification.getClickAction());
map.putString("icon", notification.getIcon());
map.putString("color", notification.getColor());
//map.putString("link", notification.getLink());

Map<String, String> data = remoteMessage.getData();
WritableMap payload = Arguments.createMap();

for(Map.Entry<String,String> entry : data.entrySet()) {
payload.putString(entry.getKey(), entry.getValue());
}

map.putMap("payload", payload);

context.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit(notificationEvent, map);
//System.out.print(remoteMessage.toString());
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-pusher-push-notifications",
"version": "2.1.0",
"version": "2.4.0",
"description": "Manage pusher channel subscriptions from within React Native JS",
"main": "index.js",
"scripts": {
Expand Down