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 ? |
Beta Was this translation helpful? Give feedback.
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.
-
@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.
-
thanks for the complete response @mikejpeters i will try it now |
Beta Was this translation helpful? Give feedback.
-
would be niice to put a migration guide as sendToDevice has different arguments than send |
Beta Was this translation helpful? Give feedback.
-
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. Has anyone experienced a similar issue or have any ideas about what could be causing this? |
Beta Was this translation helpful? Give feedback.
@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 thesend()
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:
sendToDevice()
send()
method.sendToDeviceGroup()