mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1339681 - PushServiceAndroidGCM: Send strings instead of json in event callbacks. r=Grisha
MozReview-Commit-ID: 29BEjnh1TpT --HG-- extra : rebase_source : 91c36139fdb614b30900aeb36456981fe2961162
This commit is contained in:
parent
11a122fac4
commit
44146ebe96
@ -182,6 +182,7 @@ this.PushServiceAndroidGCM = {
|
||||
type: "PushServiceAndroidGCM:DumpSubscriptions",
|
||||
})
|
||||
.then(subscriptions => {
|
||||
subscriptions = JSON.parse(subscriptions);
|
||||
console.debug("connect:", subscriptions);
|
||||
// subscriptions maps chid => subscription data.
|
||||
return Promise.all(records.map(record => {
|
||||
@ -225,6 +226,7 @@ this.PushServiceAndroidGCM = {
|
||||
// Caller handles errors.
|
||||
return EventDispatcher.instance.sendRequestForResult(message)
|
||||
.then(data => {
|
||||
data = JSON.parse(data);
|
||||
console.debug("Got data:", data);
|
||||
return PushCrypto.generateKeys()
|
||||
.then(exportedKeys =>
|
||||
|
@ -310,7 +310,7 @@ public class PushService implements BundleEventListener {
|
||||
for (Map.Entry<String, PushSubscription> entry : result.entrySet()) {
|
||||
json.put(entry.getKey(), entry.getValue().toJSONObject());
|
||||
}
|
||||
callback.sendSuccess(json);
|
||||
callback.sendSuccess(json.toString());
|
||||
} catch (JSONException e) {
|
||||
callback.sendError("Got exception handling message [" + event + "]: " + e.toString());
|
||||
}
|
||||
@ -370,7 +370,7 @@ public class PushService implements BundleEventListener {
|
||||
}
|
||||
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.SAVE, TelemetryContract.Method.SERVICE, "dom-push-api");
|
||||
callback.sendSuccess(json);
|
||||
callback.sendSuccess(json.toString());
|
||||
return;
|
||||
}
|
||||
if ("PushServiceAndroidGCM:UnsubscribeChannel".equals(event)) {
|
||||
|
Loading…
Reference in New Issue
Block a user