[英]Failure after sending push notification to specific IDs with Cloud.PushNotifications.notify
我一直在用 Titanium 开发一个聊天应用程序,当用户发送消息时我在发送推送通知时遇到了一些问题。
如果我只是打电话:
Cloud.PushNotifications.notify({
channel : 'myChannel',
to_ids : usersID.toString(),
payload : {
message : "message",
from : myId,
sound : "default",
alert : "New message!",
}
};, function(e) {
if (e.success) {
console.log('Success');
} else {
console.log('Error:\n' + ((e.error && e.message) || JSON.stringify(e)));
}
});
我从服务器得到了 OK
{"push_notification":{"id": "xxx", "payload": "{\"message\":\"message\",\"from\":\"xxx\",\"sound\":\"default\",\"alert\":\"New message!\"}", "channel": "myChannel"}, "success": true,"error": false, "meta":{"code": 200, "status": "ok", "method_name": "Notify"}}
但推送通知在 ArrowDB 面板上标有状态失败。
如果我设置为to_ids = "everyone"
,则会发送推送(只要您是管理员用户)。
奇怪的是,如果我尝试从 ArrowDB 面板发送它,我会得到同样的错误。
我不确定我做错了什么,但我试图坚持钛提供的基本示例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.