Skip to content

Commit

Permalink
Fixed Android opened and received callbacks data types
Browse files Browse the repository at this point in the history
  • Loading branch information
jkasten2 committed Oct 3, 2016
1 parent fa1d963 commit 4ddf629
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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.",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="onesignal-cordova-plugin"
version="2.0.3">
version="2.0.4">


<name>OneSignal Push Notifications</name>
Expand Down
6 changes: 3 additions & 3 deletions src/android/com/plugin/gcm/OneSignalPush.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 4ddf629

Please sign in to comment.