go-fcm icon indicating copy to clipboard operation
go-fcm copied to clipboard

FCM deprecated HTTP legacy send API

Open netrebel opened this issue 1 year ago • 8 comments

On 6/27/2023, we started getting Post \"https://fcm.googleapis.com/fcm/send\": context deadline exceeded errors (less than 0.2% of the total) in our service that sends push-notifications to FCM.

Looking at FCM announcements, I found that the current API will be discontinued in June 2024 (I'm not sure this is related the announcement):

Firebase has announced that it will discontinue legacy Firebase Cloud Messaging (FCM) APIs starting from June 20, 2024. This decision comes as part of Firebase’s efforts to enhance security and performance. As a result, certain APIs will be deprecated in favor of the available alternatives.

https://blogiestools.com/firebase-legacy-fcm-apis-discontinued/

They have already started deprecating the API, the HTTP legacy APIs was deprecated on June 20, 2023:

Caution: Sending messages (including upstream messages) with the FCM XMPP and HTTP legacy APIs was deprecated on June 20, 2023, and will be removed in June 2024. If you are using the legacy send APIs, we strongly recommend that you migrate to the HTTP v1 API or consider using the Admin SDK to build send requests.

Migration instructions

See the migration instructions here: https://firebase.google.com/docs/cloud-messaging/migrate-v1

HTTP requests before:

POST https://fcm.googleapis.com/fcm/send

After:

POST https://fcm.googleapis.com/v1/projects/myproject-b5ae1/messages:send

appleboy/go-fcm/client.go uses:

DefaultEndpoint = "https://fcm.googleapis.com/fcm/send"

Are there plans to update this Endpoint in the library?

netrebel avatar Jul 18 '23 22:07 netrebel

  • 1

pvincendeau avatar Jul 20 '23 07:07 pvincendeau

+1

petenickless avatar Nov 28 '23 16:11 petenickless

  • 1

RakiFuyumine avatar Dec 06 '23 14:12 RakiFuyumine

+1

dm-aq avatar Jan 18 '24 08:01 dm-aq

+1

esg42 avatar Jan 18 '24 10:01 esg42

I will take it.

appleboy avatar Jan 31 '24 05:01 appleboy

Hi,when do you fixed this issue ? Do you have any plan ?

huangyuhui-github avatar Feb 01 '24 07:02 huangyuhui-github

Hi there, thanks for all your work maintaining this repo. Just wanted to follow up to see if there was any ETA for this.

danielsomekh avatar Feb 29 '24 16:02 danielsomekh

Same question as last post. Would be good to know an ETA to consider waiting for the new version or completely switching implementation. This library has been working great so far sending push-notifications to FCM! Thanks for all the work. 🙏

netrebel avatar Apr 15 '24 18:04 netrebel

Found out that the library provided by Google calls the new endpoint: v1/projects/{projectsId}/messages:send: https://github.com/googleapis/google-api-go-client/blob/85b4e909e1368b10a713262dc4e416a4c7c95956/fcm/v1/fcm-api.json#L117

Will look into that as the alternative to this library.

netrebel avatar Apr 15 '24 20:04 netrebel