I ran into a problem with NotificationHubs, where occasionally notifications cannot be delivered to an iOS client.
My notification hub is configured to use token authentication using APNS (as opposed to authenticating a legacy certificate).
I have updated the notification level for the notification level to the standard to get more information about this. In most cases, notifications (more than 95%) are correct. I added registration to track the NotificationId of each push notification that was queued with notification hubs. Then, when I was notified of the failure, I went and looked at the details for this particular notification using the following method:
var details = await notificationHub.GetNotificationOutcomeDetailsAsync("<notification id>");
Checking the details, I noticed that although the state was โcompletedโ (which means that NotificationHubs received and processed the operation), PnsErrorDetailsUri was non-zero, indicating that there was a problem with the delivery of the notification:

Going to the PnsErrorDetailsUri value in the browser caused the following file to load:

Here I noticed that NotificationSystemError says there is an "InvalidToken". This token seems to be related to some under-cover messages between Azure and APNS. This is NOT NOT due to the fact that the device token registered in NotificationHubs is invalid. I checked that registerId was still in the notification hubs and pointed to the correct device. In addition, capturing the raw NotificationBody from the parts and resubmitting it using the same tag leads to the successful delivery of a new notification.
Does anyone know what an InvalidToken can say, or what could be causing these intermittent NotificationHub delivery failures?
UPDATE:
I found mention of various NotificationSystemErrors here , one of which is my InvalidToken error. However, I cannot find a description of what the actual causes of these errors are.
source share