0
나는이 오류가 무엇입니까 "을 (를) 찾을 수 없습니다 APP_ID" OneSignal 오류 : 나는 OneSignaL와 알림 게시하려고 할 때마다
function notifyUser(id, msg) {
var notificationObj = { contents: {en: msg},
include_player_ids: [id],
'Content-Type': 'application/json' };
window.plugins.OneSignal.postNotification(notificationObj,
function(successResponse) {
console.log("Notification Post Success:", successResponse);
},
function (failedResponse) {
console.log("Notification Post Failed: ", failedResponse);
alert("Notification Post Failed:\n" + JSON.stringify(failedResponse));
}
);
};
내가 '콘텐츠를 추가 : 여기
app_id not found. You may be missing a Content-Type: application/json header
내 코드입니다 -Type '부분은 오류 메시지가 표시되기 때문에 발생하지만 여전히 동일한 오류가 발생합니다. 이것은 그들의 docs에서 샘플 코드 striaght입니다 - 그들은 심지어 Content-Type을 포함하지 않는 :
window.plugins.OneSignal.getIds(function(ids) {
var notificationObj = { contents: {en: "message body"},
include_player_ids: [ids.userId]};
window.plugins.OneSignal.postNotification(notificationObj,
function(successResponse) {
console.log("Notification Post Success:", successResponse);
},
function (failedResponse) {
console.log("Notification Post Failed: ", failedResponse);
alert("Notification Post Failed:\n" + JSON.stringify(failedResponse));
}
);
});