3

EXPO SDK Version: 42.0.01 Developing for: iOS

Our goal: successfully send a test notification from Test Send tool in Azure Notification Hub to a registered physical iPhone which is running a local instance of an EXPO app.

Progress: we're able to successfully register a physical iPhone with Azure Notification Hub without using a 3rd party library. We can see that registration in the Hub.

Issues: when using the Azure's Test Send tool we're getting an error "The Push Notification System handle for the registration is invalid" and the test notification does not get delivered.

Debugging:

  • we're using EXPO's Notifications.getDevicePushTokenAsync() API to obtain the push token.
  • Azure support team analysed the logs and concluded that the problem is the PNS handle i.e. Apple's ID of the phone registered for notifications.
  • the phone's PNS handle remains the same at all times.
  • by using "expo credentials:manager" I've added a new Push Notification Key using KeyID, TeamID and .p8 certificate - the PNS handle didn't change after doing that and notifications were failing too.

I haven't found any tools to validate the APNS handle. I'm currently awaiting a .p12 certificate from our corporate team to test notifications by using https://pushtry.com/.

How do we validate the APNS handle and if found that it's invalid - how do we cycle it / request another?

kamil_k
  • 154
  • 7

1 Answers1

0

The PNS Handle from APNs does not change that often as it is tied to the device and app installation. See this answer for more details Does the APNS device token ever change, once created?

  • Thanks for response Matthew. This is helpful in understanding that the device push token once assigned will remain unchanged for some time. The issue, however, of validating that push token remains somewhat open. I was able to successfully deliver notifications generated by our serverless flow using the expo notification service. I will be conducting some further tests on expo generated token to try and pinpoint the exact bug in our flow. Once the token is ruled out, the issue we've been having might point back to Notification Hub. – kamil_k Jan 07 '22 at 11:32