[英]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.