Why iOS APNS VOIP development(sandbox) push notification is not working?

I can imagine most of the application back-end servers are leveraging AWS SNS to send push notifications to android and iOS devices for it integrated well with FCM and APNS.

One day, I found my development iOS app is not receiving VOIP push notification anymore! This is extremely scaring for those who are providing real time service like call, messaging, streaming,…etc. After immediately testing our production app and confirmed this is a ‘development-only’ issue, I got some relief.

But it still is a bummer that VOIP push is not working in sandbox. How would I test my work? I will have to upload a build to TestFlight and test it as a production environment. You want to make some modifications? Sure! Just upload another build to TestFlight and test it.

Nah, I have to figure out where is the problem. Either AWS SNS or Apple APNS.

Let’s try APNS first.

The above is Apple’s documentation about sending notifications to APNS.

Too much!? You tell me! That’s why we choose an integrated service like AWS SNS instead doing it ourselves.

Houston is a cli tool to send notification to APNS.

$ apn push "<device_token>" -c /path/APPLE_VOIP_SERVICE.pem
-m "Houston! we have a problem!"

Well, Houston can successfully send notifications and deliver to the device(sandbox). Then the problem goes to AWS SNS.

After some research and google, I found this in AWS discussion forums.

https://forums.aws.amazon.com/thread.jspa?messageID=916980

It said

Apple is ‘rejecting’ those voip push notification requests without apns-push-type header set to “voip” in sandbox, but not in production ‘yet’.

It is actually ‘ignoring’ instead of ‘rejecting’ because it won’t tell you anything but just drop your requests. And AWS SNS should be doing better job on indicating this problem when you issue an voip push request. Rightnow it tells you nothing but the “MessageId”. And it looks like everything went well.

According to

We have to specify the PUSH_TYPE by message-attributes.

Here is the cli command to send the correct voip push notification request, and it will delivery to sandbox devices!

Yeah! That’s it. I believe Apple will be ‘ignoring’ invalid voip push for production soon! So it’s better to apply this to both development(sandbox) and production.

Feel free to share some feedback.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store