10

Recently our Azure Notification Hub became a very mysterious entity. When Apple devices register we can see them in Service Bus Explorer and as soon as we try sending any notifications (from SBE or Azure Portal) we get a "Notification Successful" message, but nothing appears on the device. Refreshing registration list uncovers the fact that the registrations were deleted.

We are not removing them anywhere in code, and the TTL has not expired.

Any suggestions?

Wojtek Turowicz
  • 4,086
  • 3
  • 27
  • 38
  • Are there any new conclusions? I am experiencing the exact same symptoms you mentioned. – Yaron Levi Apr 26 '15 at 23:41
  • 1
    Turns out the front end guys were unsubscribing too eagerly. Removing the unsubscribe code sorted out the issue. Also there was a problem with the APNS certificate, in order to run the front end app in debug it requires a sandbox certificate, not a production one, for the messages to be delivered properly. – Wojtek Turowicz May 06 '15 at 10:21
  • I am having this issue but with Google messages – Zapnologica Oct 30 '19 at 14:53

3 Answers3

9

Notification hub cleans up registrations with invalid tokens during the send flow. Looks like for some reasons APNS rejects your tokens and NH just removes registrations. Make sure:

  1. you are getting token from physical device (not emulator);
  2. APNS certificate uploaded to NH is not expired;
  3. APNS certificate uploaded to NH corresponds APNS endpoint you are using in application (sandbox or production).
efimovandr
  • 1,594
  • 9
  • 11
  • 1
    1. I'm using a device 2. Not expired 3. Set correctly (checked with the Provisioning quicklook plugin) – Wojtek Turowicz Jan 29 '15 at 09:49
  • I can take a look at logs. I only need namespace name and time when send call was done (+/-10 min is OK), tracking id would be also helpful but not required. – efimovandr Jan 29 '15 at 19:43
  • for me it was an issue of registering with a wrong pns handle(I thought my gcm project number would be the handle). You have to first separately register with the related vendor pns, then supply that handle when you register with Azure Notifiction hub – AmmarCSE Mar 13 '16 at 16:51
3

Turns out the front end guys were unsubscribing too eagerly. Removing the unsubscribe code sorted out the issue. Also there was a problem with the APNS certificate, in order to run the front end app in debug it requires a sandbox certificate, not a production one, for the messages to be delivered properly.

Wojtek Turowicz
  • 4,086
  • 3
  • 27
  • 38
1

We had this exact error, but it turned out we were accidently using a "distribution" provisioning profile with a "development"/ sandbox push notification certificate. After switching to a development provisioning profile, push notifications worked!

r590
  • 689
  • 1
  • 10
  • 15