Taha Younis
Taha Younis

Reputation: 9

send notification to all tokens

When I want to send Notification to all devices I retrieve all tokens of devices in List and try to send notification to all devices with this List but that work for just the first device's token

Thx

Upvotes: -1

Views: 270

Answers (1)

stersym
stersym

Reputation: 308

This is not the way to send a notification to multiple devices. Looping through all of the tokens isn't needed. Firebase provides a way called Topic Messaging.

For example you can subscribe all your devices to a topic called All and then message the All topic.

Here is the documentation: Firebase Topic Messaging

Upvotes: 0

Related Questions