Skip to content

Commit

Permalink
Merge pull request MoSync#393 from Sionarch/ThreeTwoOne
Browse files Browse the repository at this point in the history
[WORMHOLE-3] Push Notification callback receives message string with cor...
  • Loading branch information
milesm committed Mar 6, 2013
2 parents d8dfd84 + e192611 commit 4cdc079
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions libs/Wormhole/Libs/Notification/PushNotificationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,25 @@ namespace Wormhole

sprintf(
data,
"\\'{\"message\": \"%s\","
"{\"message\": %s,"
"\"sound\": \"%s\","
"\"iconBadge\":\"%d\"}\\'",
message.c_str(),
"\"iconBadge\":\"%d\"}",
Encoder::JSONStringify(message.c_str()).c_str(),
sound.c_str(),
iconBadge);

mMessageHandler->callSuccess(
mListenerCallBack,
PHONEGAP_CALLBACK_STATUS_OK,
data,
true);
String args = "";
args += "{";
args += "\"status\":" + ((MAUtil::String) PHONEGAP_CALLBACK_STATUS_OK);
args += ",\"message\":" + Encoder::JSONStringify(data);
args += ",\"keepCallback\":true";
args += "}";

String script = "PhoneGap.CallbackSuccess(";
script += "'" + mListenerCallBack + "',";
script += Encoder::JSONStringify(args.c_str()) + ")";

mMessageHandler->callJS(script);
}

/**
Expand Down

0 comments on commit 4cdc079

Please sign in to comment.