diff --git a/src/android/com/gae/scaffolder/plugin/FCMPlugin.java b/src/android/com/gae/scaffolder/plugin/FCMPlugin.java index 5c34dc672..f8101987c 100644 --- a/src/android/com/gae/scaffolder/plugin/FCMPlugin.java +++ b/src/android/com/gae/scaffolder/plugin/FCMPlugin.java @@ -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 payload) { - Log.d(TAG, "==> FCMPlugin sendPushPayload"); + public static void setInitialPushPayload(Map payload) { if(initialPushPayload == null) { initialPushPayload = payload; } + } + + public static void sendPushPayload(Map payload) { + Log.d(TAG, "==> FCMPlugin sendPushPayload"); try { JSONObject jo = new JSONObject(); for (String key : payload.keySet()) { diff --git a/src/android/com/gae/scaffolder/plugin/FCMPluginActivity.java b/src/android/com/gae/scaffolder/plugin/FCMPluginActivity.java index 7562b1072..35acda3b1 100644 --- a/src/android/com/gae/scaffolder/plugin/FCMPluginActivity.java +++ b/src/android/com/gae/scaffolder/plugin/FCMPluginActivity.java @@ -42,6 +42,7 @@ private void sendPushPayload() { Log.d(TAG, "\tKey: " + key + " Value: " + value); data.put(key, value); } + FCMPlugin.setInitialPushPayload(data); FCMPlugin.sendPushPayload(data); }