Open AlvinStefanus opened 1 year ago
When I tried to send a push notification from my node.js server, the iOS devices got this error:
Requested entity was not found
The code to send the notification is this:
var admin = require("firebase-admin"); // Get it from firebase console -> service accounts var serviceAccount = require("../fcmKey.json"); admin.initializeApp({ credential: admin.credential.cert(serviceAccount), }); export const sendFCM = (dest: string[], title: string, content: string) => { const msg = { data: { title, content }, notification: { title, body: content, }, tokens: dest, }; admin .messaging() .sendMulticast(msg) .then((response: any) => { // Response is a message ID string. console.log("Successfully sent message:", response); }) .catch((error: any) => { console.log("Error sending message:", error); }); };
I read that the token should be refreshed, but this library does not have a way to refresh the token.
Please advice.
When I tried to send a push notification from my node.js server, the iOS devices got this error:
The code to send the notification is this:
I read that the token should be refreshed, but this library does not have a way to refresh the token.
Please advice.