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.
Sending Notification Requests to APNs
When you have a notification to send to a user, your provider must construct a POST request and send it to Apple Push…
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.
Push Notifications don't have to be difficult. Houston is a simple gem for sending Apple Push Notifications. Pass your…
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.
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.
Send Custom Platform-Specific Payloads to Mobile Devices
Send custom platform-specific payloads to mobile devices .
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.