FCM configuration for Azure Notification Hub

November 25th 2022 Firebase Azure

I recently had to configure a new instance of Azure Notification Hub for Android/Firebase notifications. The configuration page in the Azure portal requires only one piece of information, an API key:

FCM Configuration in Azure portal

I expected it to be easy to find the API key in the Firebase dashboard, but that was not the case. At least, it was not available on the Cloud Messaging tab of the Project settings page:

Firebase Cloud Messaging Project setting

I could not find clear instructions in the Azure Notification Hub documentation, but according to a 2019 blog post, I had to use FCM Legacy Mode. This was disabled by default, so I clicked on the icon with the three dots next to it and then on the single link in the drop-down menu that opened:

Legacy Cloud Messaging API drop-down menu

On the page that opened in a new tab, there was an option to enable Cloud Messaging:

Cloud Messaging Enable button

I clicked the button and waited a while for the process to complete. After I was redirected to another page, I closed it and refreshed the Cloud Messaging Project settings page I started at. Now the legacy API was enabled and there was a Server key available for it. This is the API Key you need to provide in the Azure portal.

Legacy Cloud Messaging API Server key

In hindsight, the process is not too complicated. But I could not find any good documentation on it either, so I decided to document it in this post for future reference. I hope that Azure Notification Hub will eventually implement full support for FCM and will no longer need the legacy mode. I am not too optimistic, though, as there have been no new announcements on the Azure blog about this since the 2019 post mentioned above.

Get notified when a new blog post is published (usually every Friday):

Copyright
Creative Commons License