【发布时间】:2015-02-15 22:07:28
【问题描述】:
我正在尝试设置推送通知后台作业。 - 运行后台作业时出现以下错误-
E2015-02-15T21:45:23.581Z] v20:运行工作 push_job: 输入: {} 失败:未调用成功/错误 这是我的代码 - 请帮我解决这个问题
Parse.Cloud.job("push_job", function(request, response) {
Parse.Cloud.define('httpRequest', function(request, response) {
Parse.Cloud.httpRequest({
method: "POST",
headers: {
"X-Parse-Application-Id": "xxxxxxxcxxxxxxxxxxxxx",
"X-Parse-REST-API-Key": "xxxxxxxxxxxxxxxxxxxxxx",
"Content-Type": "application/json"
},
body: {
"data": {
"alert": "Local push notification"
}
},
url: "https://api.parse.com/1/push"
}).then(function() {
response.success();
console.log("Successful push");
}, function(error) {
response.error(error);
console.log(error);
});
});
});
【问题讨论】:
-
想出了解析推送通知作业(计划,根据用户本地时间运行)
标签: background parse-platform push-notification jobs parse-cloud-code