Skip to content

Commit

Permalink
Fixed initialPushPayload being set by non-tapped notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
andrehtissot committed Sep 6, 2020
1 parent 22e2387 commit 12bbbcb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/android/com/gae/scaffolder/plugin/FCMPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,14 @@ private static void dispatchJSEvent(String eventName, String stringifiedJSONValu
Log.d(TAG, "\tSent event: " + eventName + " with " + stringifiedJSONValue);
}

public static void sendPushPayload(Map<String, Object> payload) {
Log.d(TAG, "==> FCMPlugin sendPushPayload");
public static void setInitialPushPayload(Map<String, Object> payload) {
if(initialPushPayload == null) {
initialPushPayload = payload;
}
}

public static void sendPushPayload(Map<String, Object> payload) {
Log.d(TAG, "==> FCMPlugin sendPushPayload");
try {
JSONObject jo = new JSONObject();
for (String key : payload.keySet()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ private void sendPushPayload() {
Log.d(TAG, "\tKey: " + key + " Value: " + value);
data.put(key, value);
}
FCMPlugin.setInitialPushPayload(data);
FCMPlugin.sendPushPayload(data);
}

Expand Down

0 comments on commit 12bbbcb

Please sign in to comment.