[英]Push Notification Not Arriving from Parse Cloud Code
我写了一份简单的工作,尝试向自己发送推送通知。 这是代码:
Parse.Cloud.job("testPush", function(request, status) {
Parse.Cloud.useMasterKey();
var installationQuery = new Parse.Query(Parse.Installation);
installationQuery.equalTo("user", "6t1JIuNqe1"); // I triple checked - this is the value of my user in the installation table.
Parse.Push.send({
where: installationQuery,
data: {
alert: "Test"
},
}, {
success: function() {
console.log("The Push Test Worked!");
status.success("All done with the push test!");
}, error: function(error) {
console.error("Something bad happened " + error);
status.error("Something bad happened during the Parse test...");
}
});
});
尽管它登录Parse表示作业已成功运行,但我从未在iPhone上看到任何通知。 我在“设置”中签入-所有设置均已正确设置(允许显示通知,并以横幅形式显示,它们应显示在通知中心中,并应显示在我的锁定屏幕上)。 但是通知从未出现。
我还需要检查什么? 我想念什么?
指针字段应与实例一起使用。
尝试替换installationQuery.equalTo("user", "6t1JIuNqe1");
具有以下内容:
var user = new Parse.User();
user.id = '6t1JIuNqe1';
installationQuery.equalTo('user', user);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.