Parse platform 如何使用Parse.com';s云代码

Parse platform 如何使用Parse.com';s云代码,parse-platform,google-cloud-messaging,parse-cloud-code,Parse Platform,Google Cloud Messaging,Parse Cloud Code,我正在使用Parse.com通过云代码发送推送通知。这些通知是“发送到同步”,所以我希望它们是可折叠的。可折叠意味着,如果设备关闭或未接收推送通知,则这些通知不应累积。当我的手机开机时,我不需要一大堆未送达的推送信息告诉我进行同步。我只需要一个。我认为在云代码中没有办法做到这一点。有没有办法让推送通知可折叠?这是我的云代码 Parse.Cloud.afterSave("Tagnames", function (request) { //Get the Customer that is po

我正在使用Parse.com通过云代码发送推送通知。这些通知是“发送到同步”,所以我希望它们是可折叠的。可折叠意味着,如果设备关闭或未接收推送通知,则这些通知不应累积。当我的手机开机时,我不需要一大堆未送达的推送信息告诉我进行同步。我只需要一个。我认为在云代码中没有办法做到这一点。有没有办法让推送通知可折叠?这是我的云代码

Parse.Cloud.afterSave("Tagnames", function (request) {
   //Get the Customer that is pointed to in the AlarmDefinitions object.
  query = new Parse.Query("Customers");
  query.get(request.object.get("customer").id, {
    success : function (cust) {
      //We have the customer pointed to by the AlarmDefinition.
      //Create the json payload data we will send to our clients.
      console.log("Customer=" + cust.get("customer"));
      console.log("action:" + "com.jrb.scadaalarm.rcvr.UPDATE_TAGNAMES");
      //send the push so that all customers can get notified.
      Parse.Push.send({
        channels : [cust.get("customer")],
        data: {
          action: "com.jrb.scadaalarm.rcvr.UPDATE_TAGNAMES"
        }
      }, {
        success : function () {
          // Push was successful
          console.log("Push successful.");
        },
        error : function (error) {
          // Handle error
          console.error("Push failed: " + error.code + " : " + error.message);
        }
      });

      //
    },
    error : function (error) {
      console.error("Got an error " + error.code + " : " + error.message);
    }
  });
});

不幸的是,Parse看起来不支持可堆叠的通知。看看这个答案,在这里,从解析档案