diff --git a/package.json b/package.json index 15e96a89..66eec04d 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "2.0.2", + "version": "2.0.4", "name": "onesignal-cordova-plugin", "cordova_name": "OneSignal Push Notifications", "description": "OneSignal is a high volume Push Notification service for mobile apps. In addition to basic notification delivery, OneSignal also provides tools to localize, target, schedule, and automate notifications that you send.", diff --git a/plugin.xml b/plugin.xml index 05f31e43..4100e54e 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="2.0.4"> OneSignal Push Notifications diff --git a/src/android/com/plugin/gcm/OneSignalPush.java b/src/android/com/plugin/gcm/OneSignalPush.java index 17e08a52..dc958615 100644 --- a/src/android/com/plugin/gcm/OneSignalPush.java +++ b/src/android/com/plugin/gcm/OneSignalPush.java @@ -85,14 +85,14 @@ private static void callbackSuccess(CallbackContext callbackContext, JSONObject if(jsonObject.has("payload")) { try { JSONObject payload = jsonObject.getJSONObject("payload"); - if(payload.has("additionalData")) { + if (payload.has("additionalData")) { payload.put("additionalData", new JSONObject(payload.getString("additionalData"))); jsonObject.put("payload", payload); } } catch (Throwable t) {t.printStackTrace();} } - PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, jsonObject.toString()); + PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, jsonObject); pluginResult.setKeepCallback(true); callbackContext.sendPluginResult(pluginResult); } @@ -102,7 +102,7 @@ private static void callbackError(CallbackContext callbackContext, JSONObject js jsonObject = new JSONObject(); } - PluginResult pluginResult = new PluginResult(PluginResult.Status.ERROR, jsonObject.toString()); + PluginResult pluginResult = new PluginResult(PluginResult.Status.ERROR, jsonObject); pluginResult.setKeepCallback(true); callbackContext.sendPluginResult(pluginResult); }