-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for sending batches of messages in API/v1 #114
Comments
I'd like batch support as well. Any plans to implement? If not, would you accept a PR that adds? For now, either: Option (a) add a method called |
It seems to me that the problem is not entirely relevant, this API will soon be deleted from Google and it will be necessary to think about how to switch to supporting a new one. https://firebase.google.com/support/faq?hl=ru#fcm-23-deprecation. If I understood everything correctly of course. |
The gem already support the new standard the format that will be deprecated will be the send thought you can check on code https://github.com/decision-labs/fcm/blob/master/lib/fcm.rb#L8 So we still need this implementation to send in batches |
@sabman Hello, I see that you have closed the issue, but I do not see any changes in the functionality of the library over the past year? |
Can you please try with new version |
We would love to, but using topics is not suitable for us, because... We send messages containing sensitive information to our users. And we also have a system for delineating user rights, which is processed in the backend. Shifting this task to the frontend with subscribing/unsubscribing to topics is not safe 😢 |
@JerakRus According to firebase doc:
This means you can just loop your tokens and send messages one by one, adding this batch method to gem would be doing the same I believe |
@erimicel What you described is implemented using the send_v1 sending method - we have already done this earlier, otherwise we would now be sitting without push notifications. The method shared above seems to still send messages to “topics” and this requires managing channel subscriptions on the application side. As I wrote above, this approach does not suit us and we cannot test it. But I'm sure this will suit someone else, and it's a useful feature, thanks! I wrote so that someone else who finds the method suitable would test it. |
Feature Request
Is your feature request related to a problem? Please describe.
I'm using the 'fcm' gem in my Rails project to send my push notifications via Firebase. The problem I'm encountering is that the gem does not currently support batch messages (API/v1, the legacy works perfect). This means that I have to send each message individually, which is quite inefficient
Describe the solution you'd like
According to the Firebase Documentation, the REST API and Admin SDKs support sending messages in batches of up to 500 messages. This feature allows developers to group messages together and send them in a single API call, providing significant performance improvement over sending individual HTTP requests for each message.
Describe alternatives you've considered
Without this feature, I'm forced to loop through each message and send it individually or build the batch logic myself — which I think should belong in this gem.
Thank you for your consideration.
The text was updated successfully, but these errors were encountered: