Header Ads

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) {
return err;

No comments

If you have any doubt, please let me know.

Powered by Blogger.