Iv migrated to to the FCM APY V1 and have the code setup like this:
async function sendPushNotification(recieverId) {
const FIREBASE_API_KEY =
"mike";
const message = {
registration_ids: [recieverId],
notification: {
title: "title here",
body: "Your account has been verified.",
vibrate: 1,
sound: 1,
show_in_foreground: true,
priority: "high",
content_available: true,
},
};
let headers = new Headers({
"Content-Type": "application/json",
Authorization: "Bearer " + FIREBASE_API_KEY,
});
let response = await fetch(
":send",
{
method: "POST",
headers,
body: JSON.stringify(message),
}
);
response = await response.json();
}
tried following this doc and the changes I made from the old stuff is
I am now using :send
and the other change is Authorization: "Bearer " + FIREBASE_API_KEY
Below was what I have been using which worked fine up until the new migration:
async function sendPushNotification(recieverId) {
const FIREBASE_API_KEY =
"key";
const message = {
registration_ids: [recieverId],
notification: {
title: "title",
body: "Your account has been verified.",
vibrate: 1,
sound: 1,
show_in_foreground: true,
priority: "high",
content_available: true,
},
};
let headers = new Headers({
"Content-Type": "application/json",
Authorization: "key=" + FIREBASE_API_KEY,
});
let response = await fetch(";, {
method: "POST",
headers,
body: JSON.stringify(message),
});
response = await response.json();
}
Any help on getting these push notifications sent out?