Adds X-Parse-Push-Status-Id header (#1412)

* Adds X-Parse-Push-Status-Id header

* Waits for _PushStatus to be stored
This commit is contained in:
Florent Vilmart
2016-04-07 18:08:09 -04:00
parent cedac3fda6
commit bc96f0beb1
5 changed files with 29 additions and 10 deletions

View File

@@ -38,7 +38,7 @@ export class PushController extends AdaptableController {
return !!this.adapter;
}
sendPush(body = {}, where = {}, config, auth, wait) {
sendPush(body = {}, where = {}, config, auth, onPushStatusSaved = () => {}) {
var pushAdapter = this.adapter;
if (!this.pushIsAvailable) {
throw new Parse.Error(Parse.Error.PUSH_MISCONFIGURED,
@@ -84,6 +84,7 @@ export class PushController extends AdaptableController {
return Promise.resolve().then(() => {
return pushStatus.setInitial(body, where);
}).then(() => {
onPushStatusSaved(pushStatus.objectId);
return badgeUpdate();
}).then(() => {
return rest.find(config, auth, '_Installation', where);