Parse Push Notification Remove Scheduled Push

2019-08-03 13:48发布

问题:

I have scheduled a parse push notification using cloud code. Now is there a way

  1. change the date/time of that notification.
  2. remove this notification from schedule.


     var query = new Parse.Query(Parse.Installation);
        query.equalTo('group_id', 'xxx');

        Parse.Push.send({
          where: query,
          data: {
            alert: "You previously created a reminder for the game today"
          },
          push_time: new Date(2014, 12, 30)
        }, {
          success: function() {
            // Push was successful
          },
          error: function(error) {
            // Handle error
          }
        });

回答1:

There currently is NO API methods for this. I will update my answer when any major updates to their SDK have been published.

A work around is schedule a local push notification within Apples/Googles allowance and alter it thereafter when necessary.

Conversely,

Another way you could do it but will be code heavy; but create a push notification class on Parse Backend. Have pointers to users and create a few columns, one specifically will be a Parse Date with the proposed notification time. Update when necessary through the users device actions that way your not locked down to the one notification method set in stone. Everything is handled via cloud.