3

In the Azure Portal, I created a Notification Hub. And in "Push notification services - Google (GCM)", I entered the API Key value that I obtained from GCM.

In order to verify my settings of Azure Notification Hub and GCM, I ran 'Test Send' in Azure Portal - Notification Hub.

I got a message in Portal soon as below.

Successfully sent test message. Outcome: {1 passed, 0 failed}. Please see result section for details.

BUT I have not gotten any message traffic in GCM. Refer to the screenshot, please. enter image description here

I have worked for a whole day but I'm still vague about what went wrong. Any ideas? Thank you in advance.

Nikita R.
  • 7,245
  • 3
  • 51
  • 62
Johnson
  • 157
  • 3
  • 17

3 Answers3

3

Do you have a mobile (Android) client that is registered on both Notification Hubs and GCM?

NH won't send to GCM unless it has a registered client.

Adrian Hall
  • 7,990
  • 1
  • 18
  • 26
  • I was going through the tutorial of Microsoft: https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-android-get-started-push/ I have finished the Android app and it works fine on virtual device in emulator except that it never received any notification from GCM. – Johnson Aug 11 '16 at 02:33
  • I also wonder how to check if there are some devices which have been regsitered on GCM or Notification Hub. – Johnson Aug 11 '16 at 02:38
  • The app works fine on AVD, and it has MyHandler class and code: ToDoActivity.mClient.getPush().register(gcmRegistrationId);. So I think it SHOULD have registered to GCM. But I don't know how to verify that. And my app also has not received notofications from GCM. – Johnson Aug 11 '16 at 04:01
  • The easiest way is to fire up a Visual Studio instance, install the Azure SDK. There is a place in the Server Explorer where you can see the devices that are registered, so you can see if the device is registered. You can also send a test push from the same place and see if it was sent – Adrian Hall Aug 11 '16 at 17:13
0

What @adrian-hall said and also see whether Notification Hubs diagnosis guidelines help.

There's also an article on how to use Visual Studio Server Explorer to debug Notification Hubs issues.

Nikita R.
  • 7,245
  • 3
  • 51
  • 62
0

Pay attention to:

  1. The package name in you manifest file, it MUST be the same to the package name when you create new App in the firebase
  2. You need to change Google-Services.Json properties Build Action to googleServices.Json
Amir Touitou
  • 3,141
  • 1
  • 35
  • 31