Okay hab den Code jetzt ein bisschen angepasst:
//Push-Benachrichtigung bei Alarmierung
const sendPush = (title, message) => {
const options = {
method: 'POST',
url: 'https://fcm.googleapis.com/v1/projects/project/messages:send',
headers: {
'Content-Type': 'application/json',
Authorization: getState(APITOKEN).val.toString() },
data: {
message: {
topic: 'topic',
notification: {title: title, body: message}
}
}
};
axios.request(options).catch(error => {
console.error(error);
});
};
So funktioniert es wieder. Warum auch immer der andere weg über axios.post etc. nicht gehen will.