Argun's covered the specifics of the APNs itself fairly well, but I do have some general comments based on my own experience with VoIP:
We keep track of when we sent out the APNs request and when the phone started ringing. The p95 latency is about 2 seconds (mean is ~800ms), which feels quite long.
A few things to be careful/aware of about gathering and analyzing this kind of data:
-
Your app can end up receiving VoIP pushes LONG after (minutes and even hours) after they would have expired, which can and does completely distort any kind of statistical analysis. These delays are essentially "always" caused by network-level issues making the device unreachable, so they need to be thought of as a separate edge case outside of "normal" call latency.
-
Note that we specifically introduced a new delegate method to help your app deal with these kinds of delays. If you're not using it already, you should be. See this post for more details.
-
Make sure you're accounting for delays within your own app, particularly app launch time. I've seen apps take 2s+ to launch into the background and, even worse, I've seen VoIP apps where most of that time was in pre-main initialization, which ended up "hiding" their actual launch time from their own analysis.
-
Many developers are concerned about on-device delays (time between the push reaching the device and the push reaching the app) but, in my experience, this factor is essentially irrelevant. The time itself is fairly constant (well below 0.1s) and, more importantly, I've never seen any case where apnsd or callservicesd "delayed" a push in any meaningful way. That is, once a push reaches the device, any delay or failure I've ever seen has been caused by the app itself, not the system.
Having said that:
Is this normal?
...yes, I'd consider 2s to be well within the "normal" range. Historically, my rule of thumb was to expect ~4s of latency, but it's been a while since I actively tested it and I suspect network improvements have driven that number down somewhat.
Our requests look like this:
I don't know why you've included "content-available", but I wouldn't include it in a VoIP push. It's not necessary in a VoIP push (VoIP pushes are "inherently" invisible), so you're basically just wasting payload. More importantly, if something were to go wrong and you started sending VoIP pushes as standard pushes AND those pushes somehow reach the device in a deliverable state, then it would be better to show "something" (so you'd realize there was a problem) instead of having them fail invisibly.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware