firebase-admin-go icon indicating copy to clipboard operation
firebase-admin-go copied to clipboard

Legacy API Deprecation for FCM

Open euantorano opened this issue 1 year ago • 4 comments

We've received an email yesterday regarding deprecation of the legacy API for FCM. It links to an FAQ entry, which says to migrate usages of SendMulticast to SendEachForMulticast.

It doesn't look like this has been implemented yet in the released version of this module, or in this repository as far as I can see, yet the FAQ specifically mentions the Go version of the Firebase Admin SDK.

Is there a plan or roadmap for implementing this change? Obviously the email states the deprecation date is 20/06/2024, and an email has gone out already. I'd expect there will probably be several teams looking at making the required changes sooner rather than later as well so the changes can be fully tested before the deprecation date.

euantorano avatar Jun 21 '23 09:06 euantorano

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Jun 21 '23 09:06 google-oss-bot

Ditto batch sending via SendAll (that's what the email told me I needed to stop using in the next 12 months).

themartorana avatar Jun 22 '23 15:06 themartorana

Hey all, this has been addressed in v4.12.0 of the SDK: https://firebase.google.com/support/release-notes/admin/go#cloud-messaging

thatfiredev avatar Jul 14 '23 19:07 thatfiredev

Are there plans to a real multicast method? IMO, SendMulticast and SendEachForMulticast are not doing the same thing at all.

SendEachForMulticast does 1 request per registration_ids, where SendMulticast sends 1 request by grouping all messages into one HTTP Request.

It can lead to a radical server load over to the previous method, as it requires to establish one SSL Handshake for every request

baptistejamin avatar Jan 18 '24 10:01 baptistejamin

These changes were needed in the SDK due to the deprecation of batch send APIs in the backend. We are currently investigating ways to further optimize the new sendEach and SendEachForMulticast methods including http/2 streaming. Stay tuned!

lahirumaramba avatar Mar 05 '24 17:03 lahirumaramba

These changes were needed in the SDK due to the deprecation of batch send APIs in the backend. We are currently investigating ways to further optimize the new sendEach and SendEachForMulticast methods including http/2 streaming. Stay tuned!

Any update on this? In general I'm wondering how people will continue to use Firebase for high scale applications when the batch send API is deprecated, given that the write calls are limited to just 80 every 100s. Not sure if I'm missing something, or if the rate limits will be increased for writes. Otherwise I don't see how developers can use firebase to send out thousands of pushes at a time, unless they use the topic model, which will not work for many use cases.

NickOttrando avatar Apr 10 '24 19:04 NickOttrando

Regardless of the development language, large services using the batch API through the Firebase SDK are all facing the same issue. This indicates that the support period for using the batch API in the Firebase SDK should be extended. https://github.com/firebase/firebase-admin-java/issues/941

honorhs avatar May 08 '24 14:05 honorhs

Step 1:

go to https://developers.google.com/oauthplayground/

1.Select the autorize api and after fill the input your own scopes (email, https://www.googleapis.com/auth/firebase.messaging) once it is complete after displayed the client id and client secret key for refresh_token.

Step 2: POST => https://developers.google.com/oauthplayground/refreshAccessToken

{"token_uri":"https://oauth2.googleapis.com/token","refresh_token":"1//04BZzVDcaVl4vCgYIARAAGAQSNwF-L9IrPUzn_0****"} in body

Step 3:

POST =>> https://fcm.googleapis.com/v1/projects/chat-2dc2d/messages:send

headers: Bearer Y29**********.......

{ "message": { "token": "*********", "notification": { "title": "Sample", "body": "Sample" } } } in body

Sankarvjss78 avatar Jul 25 '24 10:07 Sankarvjss78