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: 4 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.
@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()