Reputation: 9
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
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