Ios 推送通知未从解析云代码到达
我写了一个简单的作业,尝试向自己发送推送通知。代码如下:Ios 推送通知未从解析云代码到达,ios,parse-platform,push-notification,parse-cloud-code,Ios,Parse Platform,Push Notification,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 ch
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(“用户”、“6t1JIuNqe1”)代码>包含以下内容:
var user = new Parse.User();
user.id = '6t1JIuNqe1';
installationQuery.equalTo('user', user);
您看到日志中的任何消息了吗?安装中
user
列的数据类型是什么,字符串还是指针?@eth3lbert-是,我看到消息“推送测试成功!”<代码>用户是一个指针。。。我是否将.equalTo()
设置得不正确以处理指针?今晚我将尝试此设置,并让您知道它是否有效。