• 1000 не работает.
Это мой JavaScript Код:
var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
var xhttp = new XMLHttpRequest();
xhttp.open("POST", "https://fcm.googleapis.com/fcm/send", true);
xhttp.setRequestHeader("Content-type", "application/json");
xhttp.setRequestHeader("Authorization", "key="+key);
let res = {'notification': {
'title': 'Test',
'body': 'Notificación enviada desde Firebase'
},
'to':token,
}
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
console.log(xhttp.responseText)
}
};
xhttp.send(JSON.stringify(res))