Migrate Cloud Messaging API(Legacy) to FCMv1 on Azure Notification hub

467 Views Asked by At

Azure Notification hub needs Cloud Messaging API(Legacy) key to connect with FCM, legacy will be deprecated soon.

So how can we migrate Cloud Messaging API(Legacy) to FCMv1.

Web API key isn't useful for Azure Notification Hub as if you try insert this key into the API key entry for a hub

Question: What do I have to paste into Azure's push notifications settings where my FCM key was used before?

3

There are 3 best solutions below

1
Suresh Chikkam On

Create a firebase project in google firebase.

enter image description here

Then navigate to settings > cloud messaging then you can find Cloud Messaging API (Legacy) key.

enter image description here

Add the server key in Azure notification hub - Settings > Google (GCM/FCM) and click on save.

enter image description here

I have an application which can communicate with ANH that can receive the notification which I sent and from ANH to (GCM/FCM).

enter image description here

  • By following the above steps, you'll have successfully migrated from Cloud Messaging API (Legacy) to FCM for use with Azure Notification Hub. push notifications will continue to work seamlessly and avoids any issues related to the deprecation of the legacy Cloud Messaging API.
2
SzybkiDanny On

They recently introduced a new tab "Google (FCM v1)" on Notification Hub configuration page in Azure Portal. You can configure your FCM v1 credentials there:

enter image description here

You'll need to generate a new set of credentials to FCM using a Service account. You can find detailed instruction here: https://learn.microsoft.com/en-us/azure/notification-hubs/firebase-migration-rest#step-1-add-fcm-v1-credentials-to-hub

0
Tanimak On

Azure notification hubs introduced FCM V1 functionality recently.

Go to Firebase console, Select your project then project settings. Then go to Service Accounts tab. Here you can find a button Generate new private key. This will give you a JSON file that you will need in next step.

In your notification hub instance you can find the new Google FCM v1 option in the side navigation. Fill the required fields with the information from the JSON file downloaded previously.

With this change, When registering you will need to go through the FCM v1 API, so that Firebase will know you are registering for FCM V1. When dispatching the notifications to users, again you need to go to FCM V1 API.

The latest SDK's should have these new methods for FCM V1 functionalities.

I have written an article describing my experience with the migration https://medium.com/@pramodyahk/migrating-to-fcm-v1-in-azure-notification-hubs-android-push-notifications-c342d76adfb2