Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 677ba39

Browse files
Merge pull request #510 from bpeterman/master
Add FCM data to the data key
2 parents ea4b26e + 6846fd4 commit 677ba39

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
38 Bytes
Binary file not shown.

platforms/android/libraryproject/firebase/src/main/java/org/nativescript/plugins/firebase/MyFirebaseMessagingService.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ public void onMessageReceived(RemoteMessage remoteMessage) {
2727
}
2828

2929
final Map<String, String> data = remoteMessage.getData();
30+
final JSONObject data_json = new JSONObject();
3031
for (Map.Entry<String, String> stringStringEntry : data.entrySet()) {
31-
json.put(stringStringEntry.getKey(), stringStringEntry.getValue());
32+
data_json.put(stringStringEntry.getKey(), stringStringEntry.getValue());
3233
}
34+
json.put("data", data_json);
3335

3436
FirebasePlugin.executeOnNotificationReceivedCallback(json.toString());
3537
} catch (JSONException e) {

0 commit comments

Comments
 (0)