From 7a21dffd1f61628b17b6594b2e4162773ba0cbdd Mon Sep 17 00:00:00 2001 From: Simon MacDonald Date: Fri, 24 Jun 2016 16:40:42 -0400 Subject: [PATCH] Issue #1002: FYI: Resumed iOS 10 Notifications results in an error --- .../adobe/phonegap/push/BackgroundActionButtonHandler.java | 2 +- src/android/com/adobe/phonegap/push/PushConstants.java | 1 + src/android/com/adobe/phonegap/push/PushHandlerActivity.java | 2 +- www/push.js | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/android/com/adobe/phonegap/push/BackgroundActionButtonHandler.java b/src/android/com/adobe/phonegap/push/BackgroundActionButtonHandler.java index f8642e33a..d10133fcc 100644 --- a/src/android/com/adobe/phonegap/push/BackgroundActionButtonHandler.java +++ b/src/android/com/adobe/phonegap/push/BackgroundActionButtonHandler.java @@ -25,7 +25,7 @@ public void onReceive(Context context, Intent intent) { originalExtras.putBoolean(FOREGROUND, false); originalExtras.putBoolean(COLDSTART, false); - originalExtras.putString(CALLBACK, extras.getString("callback")); + originalExtras.putString(ACTION_CALLBACK, extras.getString(CALLBACK)); PushPlugin.sendExtras(originalExtras); } } diff --git a/src/android/com/adobe/phonegap/push/PushConstants.java b/src/android/com/adobe/phonegap/push/PushConstants.java index 2176c3789..34c951a81 100644 --- a/src/android/com/adobe/phonegap/push/PushConstants.java +++ b/src/android/com/adobe/phonegap/push/PushConstants.java @@ -15,6 +15,7 @@ public interface PushConstants { public static final String VIBRATE = "vibrate"; public static final String ACTIONS = "actions"; public static final String CALLBACK = "callback"; + public static final String ACTION_CALLBACK = "actionCallback"; public static final String DRAWABLE = "drawable"; public static final String MSGCNT = "msgcnt"; public static final String VIBRATION_PATTERN = "vibrationPattern"; diff --git a/src/android/com/adobe/phonegap/push/PushHandlerActivity.java b/src/android/com/adobe/phonegap/push/PushHandlerActivity.java index 7993d97aa..04daa12fe 100644 --- a/src/android/com/adobe/phonegap/push/PushHandlerActivity.java +++ b/src/android/com/adobe/phonegap/push/PushHandlerActivity.java @@ -60,7 +60,7 @@ private void processPushBundle(boolean isPushPluginActive) { originalExtras.putBoolean(FOREGROUND, false); originalExtras.putBoolean(COLDSTART, !isPushPluginActive); - originalExtras.putString(CALLBACK, extras.getString("callback")); + originalExtras.putString(ACTION_CALLBACK, extras.getString(CALLBACK)); PushPlugin.sendExtras(originalExtras); } diff --git a/www/push.js b/www/push.js index 0660ece0b..834e3c056 100644 --- a/www/push.js +++ b/www/push.js @@ -34,7 +34,7 @@ var PushNotification = function(options) { var success = function(result) { if (result && typeof result.registrationId !== 'undefined') { that.emit('registration', result); - } else if (result && result.additionalData && typeof result.additionalData.callback !== 'undefined') { + } else if (result && result.additionalData && typeof result.additionalData.actionCallback !== 'undefined') { var executeFunctionByName = function(functionName, context /*, args */) { var args = Array.prototype.slice.call(arguments, 2); var namespaces = functionName.split('.'); @@ -45,7 +45,7 @@ var PushNotification = function(options) { return context[func].apply(context, args); }; - executeFunctionByName(result.additionalData.callback, window, result); + executeFunctionByName(result.additionalData.actionCallback, window, result); } else if (result) { that.emit('notification', result); }