how to send push notification to multiple fcm tokens or registration_ids
export const sendPush = async (params: any) => {
try {
let message = <any>{};
message.notification = {
title: params.title,
body: params.body,
data: params.data,
content_available: true,
priority: "high",
sound: "default",
};
message.data = params.data
message.registration_ids = [...new Set(params.token)];
return await fcm.send(message);
} catch (err) {
logger.logger.error(err)
return err;
}
}
Post a Comment