0
我試圖使用REST API來取消一個待發送給單個用戶的同時也使用API(使用include_player_ids
和單個收件人)的通知,但是如果不通過REST API,我無法做到這一點關鍵,這不應該發生,因爲在manual它說在我發送這個條件是沒有必要的。OneSignal刪除通知
我做錯了什麼或者可能是OneSignal服務的問題?下面是代碼:
//Creates the notification
$.post(
"https://onesignal.com/api/v1/notifications",
{
"app_id": appId,
"include_player_ids": [userId],
"send_after": later,
"template_id": templateId
},
function(data){
localStorage.ni = data.id;
}
);
//Cancel the notification
var notificationId = localStorage.ni;
$.get("https://onesignal.com/api/v1/notifications/"+notificationId+"?app_id="+appId);
下面是取消請求的響應:
{
"errors":
[
"Please include a case-sensitive header of Authorization: Basic <YOUR-REST-API-KEY-HERE> with a valid REST API key."
],
"reference":
[
"https://documentation.onesignal.com/docs/accounts-and-keys#section-keys-ids"
]
}