Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to migrate Azure Notification hub to Firebase Cloud Messaging?

I used Azure Notification Hubs with my custom .NET backend with Apple's push notification service and Google Cloud Messaging. That means, my client app registers itself with Apple's or Google's services but notifications will be sent by Notification Hub via the backend and never directly via the vendors' services.

Now that GCM is no longer supported, I tried to migrate it over to FCM.

In the Firebase console I created a new project. The project has a name, a public facing name, a project ID and a Web API Key. All of this is information from the general tab.

In the "Cloud Messaging" tab I am presented a server key and a sender ID.

Question 1: What do I have to paste into Azure's push notifications settings where my GCM key was used before? The Web API key from "General" or the server key from "Cloud Messaging"?

Question 2: My Xamarin.Android client app had to provide the "Google API Project Number" as the sender ID for GCM, in order to register itself for push notifications. Should this now be changed to use the "sender ID" from the "Cloud Messaging" tab in the Firebase Console?

like image 314
Krumelur Avatar asked Oct 29 '22 19:10

Krumelur


1 Answers

Question 1: Yes, use the Server Key from the Cloud Messaging Tab. Since both GCM and FCM only works using a Server Key.

Question 2: Yes. Since you have to use the corresponding/correct Sender ID in order to properly register your client app to the right project.


On a side note, if you originally had a project in Google Developers Console, why not just Import it to Firebase Console? Also, GCM is still supported has been officially deprecated.

like image 137
AL. Avatar answered Nov 09 '22 11:11

AL.