1

如何定位所以推送通知发送给每个人而不是频道?

var my_msg = "Hello World";
$.ajax({
  type: 'POST',
  headers: {'X-Parse-Application-Id':"*****",'X-Parse-REST-API-Key':"*****"},
  url: "https://api.parse.com/1/push",
  data: JSON.stringify({
    "channel": "",
    "type":"ios",
    "expiration_interval": 86400,
    "data":{
      "alert": my_msg,
      "badge" :0,
      "sound":""
    }
  }),
  contentType: "application/json"
});
4

1 回答 1

5

您需要在数据中添加“where:{}”

var ParseAppID = "****";
var ParseAPIKey = "****";
var my_msg = "Hello World";
$.ajax({
    type: 'POST',
    headers: { 'X-Parse-Application-Id': ParseAppID, 'X-Parse-REST-API-Key': ParseAPIKey },
    url: "https://api.parse.com/1/push",
    data: JSON.stringify({
        "where":{},
        "data": {
            "alert": my_msg,
            "badge": 0,
            "sound": ""
        }
    }),
    contentType: "application/json"
});
于 2014-10-09T22:42:31.793 回答