Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 来自云代码的推送通知返回JSON错误_Javascript_Json_Parse Platform_Push Notification_Parse Server - Fatal编程技术网

Javascript 来自云代码的推送通知返回JSON错误

Javascript 来自云代码的推送通知返回JSON错误,javascript,json,parse-platform,push-notification,parse-server,Javascript,Json,Parse Platform,Push Notification,Parse Server,我试图从云代码启动推送通知,但我总是收到此错误 { "code":107, "message":"Received an error with invalid JSON from Parse: Cannot POST /push\n" } 我正在运行parse-server@2.2.21 Parse.Cloud.define("SendPushNotif", function(request, response){ var query = new Parse.Query(Pars

我试图从云代码启动推送通知,但我总是收到此错误

{
  "code":107,
  "message":"Received an error with invalid JSON from Parse: Cannot POST /push\n"
}
我正在运行
parse-server@2.2.21

Parse.Cloud.define("SendPushNotif", function(request, response){

  var query = new Parse.Query(Parse.Installation);
  query.equalTo('channels', ["Giants"]);

  Parse.Push.send({
    where: query,
    data: {
      "title": "Test",
      "alert": "This is a test push notification"
    }
  }, { useMasterKey: true })
  .then(function() {
      response.success(response);
    }, function(error) {
      response.success(error);
  });
});

看起来“测试”后缺少了一个逗号哦,这是我复制粘贴的错误,但是我的代码中有逗号,你知道吗@Joethemow“Test”之后好像少了一个逗号哦,这是我复制粘贴的错误,但是我的代码中有逗号,你能猜出来吗@约瑟莫