-
Notifications
You must be signed in to change notification settings - Fork 408
Cloud Messaging: The firebase-admin-sdk cloud messaging migration from legacy FCM APIs to HTTP v1 #2518
-
As I can see from the sdk code, its still using legacy FCM APIs, is there any plan to migrate it to HTTP v1 ?
Or there won't be any changes in the sdk and it will continue to work even after June 2024.
Refer: Migrate to v1 by June 2024
Beta Was this translation helpful? Give feedback.
All reactions
@georgwiltschek is correct, the send() method has always used the v1 API since it was added to this SDK in 6.0.0, so it should be safe to use regardless of what version of the SDK you are on.
The sendToDevice / sendToDeviceGroup / sendAll / sendMulticast methods will stop working, and you have the option to switch to the send() method instead, or use the new APIs provided in SDK >= 11.7.0.
Sources
In the FAQ for FCM features deprecated in June 2023 there is a section on Firebase Admin SDK APIs:
| API Name | Impact on users | Action Required |
|---|---|---|
sendToDevice() |
The API will stop working after 6/21/2024 because it calls the legacy HTTP send API. | Use the send() method. |
sendToDeviceGroup() |
The ... |
Replies: 5 comments 1 reply
-
As I understand it, the Admin SDK Code has supported the HTTP v1 API for quite a while, but you have to use the messaging().send() Method instead of sendToDevice() (and other sendTo*-Methods), since the deprecatred sendTo*() Methods use the Legacy URLs. Someone please correct me if I'm wrong.
Beta Was this translation helpful? Give feedback.
All reactions
-
|
@georgwiltschek is correct, the The SourcesIn the FAQ for FCM features deprecated in June 2023 there is a section on Firebase Admin SDK APIs:
It also says that Node.JS Firebase Admin versions >=11.7.0 have the new APIs. |
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 2
-
thanks for the complete response @mikejpeters i will try it now
Beta Was this translation helpful? Give feedback.
All reactions
-
would be niice to put a migration guide as sendToDevice has different arguments than send
Beta Was this translation helpful? Give feedback.
All reactions
-
also there is options argument for sendToDevice where we were defining
{
priority: "high",
timeToLive: 60 * 60 * 24,
collapseKey:"key....",
contentAvailable:true,
restrictedPackageName:"com.app.id",
};
and how to use this options object with suggested send method ?
Beta Was this translation helpful? Give feedback.
All reactions
-
We recently migrated our push notifications from the Legacy HTTP API to the HTTP v1 API. Since then, push notifications are not working on either iOS or Android devices. Although FCM returns a "success" response, the messages are not being received by the devices.
Here's what we have done so far:
Migrated to the HTTP v1 API following the Firebase documentation.
Verified the entire code, especially the admin.messaging() module from the Firebase Admin SDK (we're using the send() method).
No errors or outages reported by FCM.
All relevant SDKs are up to date.
Tested whether low priority or message lifespan could be causing the issue – no success.
User devices are not in sleep mode and the app does not crash upon receiving the notification.
Has anyone experienced a similar issue or have any ideas about what could be causing this?
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1