healthjoy / async-firebase

The lightweight asynchronous client that makes interaction with Firebase Cloud Messaging oversimplified.
MIT License
37 stars 14 forks source link

Improve Push Multicast to take a list of messages #50

Closed GENL closed 1 year ago

GENL commented 1 year ago

First of all, thank you for this great job.

I want to send multicast push notifications to hundreds of devices and each device has a specific notification_count also the motivation body could include the name of the device's user. With the current implementation of push_multicast(), it's impossible as the function only takes a list of device tokens, not a list of bodies and notification_count.

The solution I propose is to make push_multicast() accept a list of Messages, similar to what firebase_admin does with the send_all() function. This fixes the issue because each message can be personalized.

For now, the only alternative I used was to call hundreds of push() by chunks of 10 in a loop. This is at the cost of performance. I expect it to be a temporary solution.

akalex commented 1 year ago

Hello @GENL, Thanks for the feature request, I'll take care of it.

akalex commented 1 year ago

Hello @GENL, I am pleased to inform you that version 3.0.0 has been released. That version satisfies your need in sending batch messages.

GENL commented 1 year ago

Thank you @akalex, very well done. Already migrated to this new version.