0
votes

Our backend using the Azure Notification Hub free plan (for test), but sometimes the pushnotifications not arrive to our ios application.

Is there any REST api or something else where can we get the status of a notification?

I tried to call the Per Message Telemetry, but if I fill the header with the Authorization token Azure doesn't send me any response. If I call this endpoint without auth token I got 401 response.

1

1 Answers

0
votes

you mentioned two things which both can be the source of the problem: Azure notification misconfig, or credential issues, or IOS application misconfig. The solutions for both cases are:

Azure Notifications Hub mis-configuration: If no notifications are making through, first step should be to ensure that the correct credentials are configured in the Notification Hub matching them with the application created under their platform specific developer account.

a) Make sure that your notification hub name (without typos) is the same:

Where you are registering from the client, Where you are sending notifications from the backend, Where you have configured the PNS credentials and Whose SAS credentials you have configured on the client and the backend.

b) Make sure that you are using the correct SAS configuration strings on the client and the application backend. As a rule of thumb, you must be using the DefaultListenSharedAccessSignature on the client and DefaultFullSharedAccessSignature on the application backend (which gives permission to be able to send notification to the NH)

Apple Push Notification Service (APNS) configuration You must maintain two different hubs - one for production and another for testing purpose. This means uploading the certificate you are going to use in sandbox environment to a separate hub and the certificate you are going to use in production to a separate hub. Do not try to upload different types of certificates to the same hub as it may cause notification failures down the line. If you do find yourself in a position where you have inadvertently uploaded different types of certificate to the same hub, it is recommended to delete the hub and start fresh. If for some reason, you are not able to delete the hub then at the very least, you must delete all the existing registrations from the hub.

For the step by step guidance and additional resources, check out this MS article that is specific to your scenario: https://docs.microsoft.com/en-us/azure/notification-hubs/notification-hubs-push-notification-fixer