Skip to content
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

Firebase Legacy HTTP API discontinued by June 20, 2024 #370

Open
sjkummer opened this issue Jun 22, 2023 · 12 comments
Open

Firebase Legacy HTTP API discontinued by June 20, 2024 #370

sjkummer opened this issue Jun 22, 2023 · 12 comments

Comments

@sjkummer
Copy link

sjkummer commented Jun 22, 2023

Hey @eladnava

Google informed that the "Legacy HTTP" API used by this library will be discontinued by June 20, 2024.

This library has not been updated for a while. Do you plan to implement the new API or would you recommend to switch to Googles FCM Admin lib?
https://www.npmjs.com/package/firebase-admin

Migration Guide:
https://firebase.google.com/docs/cloud-messaging/migrate-v1?hl=en

Best regards and thanks for maintaining all the years.

@mtrezza
Copy link
Collaborator

mtrezza commented Jun 22, 2023

Would you want to open a PR?

@eladnava
Copy link
Collaborator

Hi @sjkummer,
For the time being, I would recommend switching to the official firebase-admin package published by Google. Migrating node-gcm to the new API will require a complete library rewrite, as the code design is very tightly coupled with the Legacy HTTP API currently.

If anyone has any bandwidth to perform the migration, they are welcome to submit a PR.

@eladnava
Copy link
Collaborator

Hi @sjkummer,
I've just released fcm-v1-http2, a Node.js package for sending multicast notifications using HTTP/2 multiplexing through the FCM HTTP v1 API, in case you need to send notifications to a large number of device tokens. Otherwise, I recommend using the official firebase-admin library.

@sjkummer
Copy link
Author

sjkummer commented Jun 30, 2023

Thanks for the clarifications and feedback.

I justed dived a bit deeper into the firebase-admin lib

@eladnava
Batched mutlicast should already be possible using firebase-admin too, using sendeachformulticast() right?
https://firebase.google.com/docs/reference/admin/node/firebase-admin.messaging.messaging?hl=en#messagingsendeachformulticast

But it seems like the more efficient sendall method (which executes only one RPC call instead multiple) is deprecated 🤔 is this was prevented you from using firebase-admin in your case?

https://firebase.google.com/docs/reference/admin/node/firebase-admin.messaging.messaging.md?hl=en#messagingsendall

@eladnava
Copy link
Collaborator

Hi @sjkummer,
I was surprised to discover that the official Firebase Admin Node.js SDK had been updated to include a new method sendEachForMulticast(), and developers are urged to migrate to using it instead of the now deprecated sendMulticast(). However, if you were to use this method with any large number of device tokens, your server might crash or grind to a halt, as the Firebase Admin SDK opens a new HTTP 1.0 connection for every single device token simultaneously.

That's correct - using any of the batch methods is deprecated, as Firebase also deprecated the batch API endpoints (which sendAll() and sendMulticast() rely on). The only viable alternative is HTTP/2 multiplexing for multicast notifications at scale.

I just published a blog post about this. Please give it a read and let me know what you think.

@DaveLomber
Copy link

@sjkummer @mtrezza just wondering is it something you may be interested in appfeel/node-pushnotifications#194

@siakc
Copy link

siakc commented Nov 18, 2023

Does this issue render this package obsolete?

@eladnava
Copy link
Collaborator

Hi @siakc,
That's correct.

Migrating node-gcm to use the new HTTP v1 API over HTTP/2 will require a complete rewrite of the package, as the code design is very tightly coupled with the Legacy HTTP API currently.

That means node-gcm will indeed stop working on June 20, 2024 unless it gets migrated.

If anyone has any bandwidth to perform the migration, they are welcome to submit a PR.

In the meantime, I have released a package called fcm-v1-http2, which uses the new FCM HTTP v1 API to send notifications using HTTP/2 multiplexing. You are also welcome to use the official firebase-admin library if throughout isn't important, or you do not intend to send notifications to a large number of recipients at once.

@ArmandoLinnkr
Copy link

How about appfeel/node-pushnotifications#194 though? It is supposed to add the new FCM method, no?

@eladnava
Copy link
Collaborator

@ArmandoLinnkr That Node.js library uses firebase-admin's sendEachForMulticast() method behind the scenes to send notifications using the HTTP v1 API. So you can either use that library, or use firebase-admin directly, or use my own ibrary fcm-v1-http2 if you intend to send time-sensitive notifications to a large number of recipients.

@iamromec
Copy link

Any update on this? We're so close to the deadline. Please update.

@ToothlessGear

@eladnava
Copy link
Collaborator

eladnava commented May 25, 2024

Unfortunately @ToothlessGear hasn't been active in a while.

We do urge you to migrate to another library before the June 20th deadline, such as:

  1. firebase-admin (official library)
  2. fcm-v1-http2 (if throughput is important to your sending requirements)

This is now mentioned in the package README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants