1

We are attempting to send push notifications via Azure Notification Hub and aren't able to send messages from Azure. We've tried debugging but have been unable to figure out the error from the documentation.

How can we debug this further? We've walked through MSDN's documentation in detail but haven't been able to come up with anything.

Note: We create client, without enabletest option.

NotificationHubClient.CreateClientFromConnectionString(NOTIFICATION_SERVICE_CONNECTION_STRING, NOTIFICATION_SERVICE_NAME);

Registration Process:

RegistrationDescription registration = Hub.CreateAppleNativeRegistrationAsync(deviceToken, new List() {tag123});

We are able to get registration id from the process. We appear to get back a successful RegistrationDescription that shows our registration id, tags, device token (pushId), etag and registration id. We do show successful registration operations in the Azure Monitor. However, After registering the device, we don't see an increase in active devices or registrations in our Azure dashboard.

Now, when we try to send notfication, as below,

var notification = Hub.SendAppleNativeNotificationAsync(apnsJson(), tag123);

And when we inspect the NotificationOutcome object, Success and Failure shows as 0, tracking id has a value. Results is null and State shows as 'Enqueued'. But we dont get the notification sent to the device.

We currently have only test hub setup and we verified the bundle id, certificates etc and all seem to be fine. We are not sure why Results node is empty. From documents, the response should be something like below. "Notification state: DetailedStateAvailable, success: 1, tracking id: xxxxxx-xxxx-xxxx-xxxx-xxxxxx, notification id: {empty} Platform: apple, Device reg id: {blah-blah-blah}, Result: The Notification was successfully sent to the Push Notification System, PnsHandle: xxx"

Pls help us in identifying or debug the problem and solve the same.

Is there anyway we can use the tracking id, we receive, to track it in the Azure portal, to get more details on what is wrong etc. Appreciate quick response.

Pls let me know if you need more details.

csharpnewbie
  • 789
  • 2
  • 12
  • 33
  • possible duplicate http://stackoverflow.com/questions/24543173/diagnosing-dropped-notifications-from-azure-notification-hub-to-apns?rq=1 – Brij Raj Singh - MSFT Dec 08 '15 at 05:27
  • @Brij Raj Singh - Thanks. In my case, its not just iOS but Android as well, has the problem. In both scenarios, I get tracking id and status as Enqueued, but does not get delivered. So is it possible to use that tracking id, in Azure portal, to find out what happened to it. – csharpnewbie Dec 08 '15 at 15:59
  • I am having the exact same issue. IOS not working, Android is. – Zapnologica Oct 12 '16 at 08:50
  • @csharpnewbie I know you can query a notifications status using the `notificationId` but in my case that is empty. Use the following methos `_hub.GetNotificationOutcomeDetailsAsync(notificiationId);` – Zapnologica Oct 12 '16 at 08:51

1 Answers1

2

Have you tried following https://azure.microsoft.com/en-us/documentation/articles/notification-hubs-diagnosing/? There is a delay in Azure Portal for telemetry, though you would be able to check registrations in Visual Studio immediately.

Mimi Xu
  • 326
  • 1
  • 4
  • Thanks. I am able to track my registrations. But for iOS, am still facing problems. The push notifications work fine for some devices, but not for some devices. For the devices, for which push does not work, I can see registration getting created (I call the registrations?api-version=2015-01 API). But when I send push, I dont receive it on the device, and after some time, when I do the get existing registrations, the registration also gets deleted. I checked for the problem in azure and it shows APNS Bad Channel Error & APNS Expired Channel Error for the 2 pushes I tried. – csharpnewbie Dec 13 '15 at 01:29
  • I had even done delete registrations, by using REST API and cleared all existing registrations. But even after that, this particular device, still does not receive the push. There is one more device which has same problem, but 3 other devices work fine. Since it works for 3 devices, it cant be any setup or calling wrong hub issue. – csharpnewbie Dec 13 '15 at 01:30