Reputation: 41
I'm making an Ionic/Cordova app, which needs push notifications, and have Microsoft Azure as the backend. Since GCM is deprecated in favor of FCM, I'm using that. I have used Add push notifications to your Apache Cordova app tutorial as the base, and referred from Sending push notifications to Android with Azure Notification Hubs as well.
While adding the FCM server key under GCM API Key to Azure App Service Push settings, I get the following error:
Error updating notification hub.
There are no other helpful comments with this.
Previous solutions to similar errors included enabling GCM from Google Developer Console. But FCM does not require that option, as far as I understand. What could be the problem?
Upvotes: 1
Views: 559
Reputation: 41
I've ID'ed the issue, sharing here.
It seems when CORS is enabled (via an extension in the browser), Azure does not accept/identify the FCM key. This issue is not specific to adding FCM key, when CORS is enabled, there are a lot of such issues retrieving data from Azure. I'm not sure how to get this to the people at Azure, so if anyone can, that'd be good.
PS: CORS - Cross Origin Resource Sharing, which is disabled by default by browsers, a common security feature. I had to enable it full-time for my development purpose.
Upvotes: 2