简体   繁体   中英

Send Notification To All Firebase Cloud Messaging Tokens (Web)

Angular web app (not a native app)
I have my logic working to generate and save FCM tokens.
And I can send a send a message to one token using curl in the terminal.
I have been reviewing MANY tutorials and all I have seen send messages to one token at a time.

Is it possible to send a message to all the tokens you have saved in your Firebase Realtime Database?
Do I need to use (or build) some other tool to do this?

Thre is no built-in mechanism in Firebase Cloud Messaging to send a message to "all tokens".

Instead you can call the FCM legacy API to send a message to a collection of up to 1000 tokens at a time. The key is to use the registration_ids parameter (instead of the to parameter for a single token), as AL explains here: FCM (Firebase Cloud Messaging) Send to multiple devices and here: FCM: Message to multiple registration ids limit? , and as shown in the documentation for the legacy API .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM