Ich versuche, Informationen über eine gesendete Benachrichtigung zu erhalten. Aber ich weiß nicht genau, wie ich vorgehen soll. Das ist mein Javascript-Code:Ionic Notifications Information
function obtenerInformacion(uuid){
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.ionic.io/push/notifications/"+uuid);
xhr.setRequestHeader("Access-Control-Allow-Origin","*");
xhr.setRequestHeader("Access-Control-Allow-Methods","GET,PUT,POST,DELETE,OPTIONS");
xhr.setRequestHeader("Access-Control-Allow-Headers","Content-Type");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxN2FlYWZlMC02ZTg4LTQ3NDItOWMxMC04ZTczY2IwNWU4NGMifQ.n25i9yTWdqFauTd6xnfW0Uats_x7EvnB42KhoFu8E04");
xhr.send();
}
ich diesen Fehler: error
Sorry für mein Englisch.
EDIT: Fest. Offenbar hatte der Antrag gestellt werden GET
xhr.open("GET", "https://api.ionic.io/push/notifications/"+uuid);
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxN2FlYWZlMC02ZTg4LTQ3NDItOWMxMC04ZTczY2IwNWU4NGMifQ.n25i9yTWdqFauTd6xnfW0Uats_x7EvnB42KhoFu8E04");
xhr.send();
Vielen Dank an alle
Bitte nicht Code in Fotos. Posten Sie es stattdessen in Ihrem Post als Text. – maninak
Entschuldigung. Ich habe es bereits behoben. – i02mike