APNS is delivering expired voip push notification.

I have tried setting a 'apns-expiration' to current time + 30 seconds and also a value '0'. But still my voip app receives the voip push notification after 2-3 minutes. Till this time, caller has already hung up the call. But the receivers phone still rings on receiving the push notification as we have to report it to CallKit.

Am I missing something or there is no way and even 'apns-expiration' does not guarantee timely delivery of Voip push notifications or discard if it is expired.

I have set 'apns-priority' to 10 already as recommended.

Answered by Engineer in 828161022

Due to the nature of networks, it cannot be guaranteed that a target device will not receive a notification past the apns-expiration time.

The expiration time instructs APNs to not try to send the notification after a certain time. But there will be edge cases where network delays, and especially in cases where the target device some on/off-line frequently, where notifications may end up being delivered past the requested expiration.

If the value is nonzero, APNs stores the notification and tries to deliver it at least once, repeating the attempt as needed until the specified date. If the value is 0, APNs attempts to deliver the notification only once and doesn’t store it.

A single APNs attempt may involve retries over multiple network interfaces and connections of the destination device. Often these retries span over some time period, depending on the network characteristics.

In addition, a push notification may take some time on the network after APNs sends it to the device. APNs uses best efforts to honor the expiry date without any guarantee. If the value is nonzero, the notification may deliver after the specified timestamp. If the value is 0, the notification may deliver with some delay.


Argun Tekant /  DTS Engineer / Core Technologies

Due to the nature of networks, it cannot be guaranteed that a target device will not receive a notification past the apns-expiration time.

The expiration time instructs APNs to not try to send the notification after a certain time. But there will be edge cases where network delays, and especially in cases where the target device some on/off-line frequently, where notifications may end up being delivered past the requested expiration.

If the value is nonzero, APNs stores the notification and tries to deliver it at least once, repeating the attempt as needed until the specified date. If the value is 0, APNs attempts to deliver the notification only once and doesn’t store it.

A single APNs attempt may involve retries over multiple network interfaces and connections of the destination device. Often these retries span over some time period, depending on the network characteristics.

In addition, a push notification may take some time on the network after APNs sends it to the device. APNs uses best efforts to honor the expiry date without any guarantee. If the value is nonzero, the notification may deliver after the specified timestamp. If the value is 0, the notification may deliver with some delay.


Argun Tekant /  DTS Engineer / Core Technologies

Thanks for replying.

I understand that sometimes push notification can be delivered with a delay due to network conditions. But in our case it is happening consistently.

Steps to reproduce are as below.

  1. Put our voip app in background and lock iPhone. As app is put in background, socket connections gets disconnected from server.
  2. Now if a caller makes call to this app, the call should be delivered through voip push.
  3. Voip push should ideally be received even if app is in background and iPhone is locked. It is connected to a good wifi network. But it does not receive the voip push.
  4. User unlocks iPhone and opens voip app. As soon as user opens app, the voip push is received and phone starts ringing.

To rule out dependency of server connection, the issue can be reproduced with below steps also.

  1. Put our voip app in background and put iPhone in airplane mode.
  2. Now if a caller makes call to this app, the call should be delivered through voip push. But push is not delivered because of airplane mode.
  3. Wait for few minutes and then disable airplane mode. As soon as airplane mode is disabled, we receive the voip push and phone starts ringing.
  4. But call has already been ended due to timeout, so this is just a ghost call.
  5. We had set a low value for 'apns-expiration' and so expect that the push should not be received after disabling airplane mode after waiting for few minutes.
APNS is delivering expired voip push notification.
 
 
Q