Search code examples
xamarin.formsxamarin.androidfirebase-cloud-messagingazure-notificationhub

Getting an error while adding FCM API Key to Azure Notification Hub


I have created a Azure Notification hub namespace, I'm trying to configure the Google FCM section of it by entering the API Key, but when I do that it is giving me this error

Error updating notification hub {"error":{"code":"BadRequest","message":"Invalid Firebase credentials."}}

The Key I added it from the google-services.json file

But when I send a notification from FCM console, I'm able to send it and receive the notification.

Any inputs would be appreciated


Solution

  • Azure Notification Hub doesn't support FCM (yet) but GCM as I'm writing those lines. You need to mention the server key available under your Firebase project settings in the Cloud Messaging tab. You should see something like this: Firebase Project Settings

    The key that you want to mention in Azure Notifications Hub is the purple one.

    If Cloud Messaging API (Legacy) is disabled (which should be the case by default since it's deprecated), just hit the 3 vertical dots on the right and navigate to the only available menu "Manage API in Google Cloud Console". And just enable it :)