Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Notification Hub no longer accepting GCM API Key

Tags:

Recently, every time I try to add or modify the GCM API Key in an Azure Notification Hub, I get the following error:

SubCode=40000. Failed to validate credentials with GCM. The remote server returned an error: (401) Unauthorized...

I have tried using the same key that works in other Notification Hubs, as well as creating a new one via the Google Developer's console.

I've also recently come across articles stating that GCM is moving to FCM (Firebase Cloud Messaging). Could this be the cause of my issue? Is Google beginning to no longer support GCM?

like image 629
Matt Skinner Avatar asked Sep 07 '16 21:09

Matt Skinner


People also ask

Is GCM and FCM same?

Firebase Cloud Messaging (FCM), formerly known as Google Cloud Messaging (GCM), is a cross-platform cloud solution for messages and notifications for Android, iOS, and web applications, which as of June 2022 can be used at no cost.

What is GCM API?

"App Engine Backend with Google Cloud Messaging" Template. Google Cloud Messaging (GCM) is a service that allows you to send push notifications from your server to your users' Android devices, and also to receive messages from devices on the same connection.

How do I send notifications to Azure notification hub?

To set up Windows Push Notification Service (WNS): In the Azure portal, on the Notification Hub page, select Windows (WNS) from the left menu. Enter values for Package SID and Security Key. Select Save.


1 Answers

There are two important informations:

  • Firebase Cloud Messaging (FCM) is the new version of GCM

So we should prefer Firebase Console instead of Google Cloud Console,

  • There is a useful article here Enabling Google Cloud Messaging (Firebase)

So we need to enable Google Cloud Messaging in Firebase Console for your added Android App.

Step by step:

-- Open your Firebase Console

-- Add your Android app in Firebase Console.

-- Go to Settings

-- Click CLOUD MESSAGING tab.

-- Take Legacy Server key there and use it in Azure Push Notification Service for Google(GCM) settings and Save it. That's all.

This article helps you how to create a Notification Hub Service in Azure then how to connect your Android or IOS App to Firebase Console etc.

like image 104
oguzhan Avatar answered Oct 05 '22 10:10

oguzhan