Apple Push Notification reliablity - ios

The topic I want to discuss may be a duplicate of this question. But still I've a few queries regarding Apple Push Notifications.
I have one app supported on both Android and iOS. The app needs a background service which hits a remote server every minute. The job is simple for Android app but since background tasking is not supported in iOS I need to employ push notifications for iOS app. I am using PushSharp library to deliver push notifications. Apple says that the delivery of push notification is not acknowledged. I cannot afford push notification failure since I need to send a very crucial message through notification. My questions are:
1) What is the failure rate of push notifications?
2) Are push notifications always reliable to send important messages?
3) Assume that the server which is supposed to send push notifications sends a large number of push notifications every minute. What are the chances of push notification failure in such a case?
4) Which circumstances cause push notification delivery to fail?
If you have any useful resources please provide the same. Thanks.

Please find my comments below.Hope this helps.
What is the failure rate of push notifications?
Apple has not disclosed it so far.
Are push notifications always reliable to send important messages?
Delivery of notifications is a “best effort”, not guaranteed. It is not intended to deliver data to your app, only to notify the user that there is new data available.
Please refer - https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html
Assume that the server which is supposed to send push notifications sends a large number of push notifications every minute. What are the chances of push notification failure in such a case?
Only one recent notification for a particular application is stored. If multiple notifications are sent while the device is offline, each new notification causes the prior notification to be discarded. This behavior of keeping only the newest notification is referred to as coalescing notifications.
Please refer - https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html
Which circumstances cause push notification delivery to fail?
If APNs attempts to deliver a notification but the device is offline, the notification is stored for a limited period of time, and delivered to the device when it becomes available.
Please refer - https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html

Related

What is the difference between VoIP notifications and notification sent with apns-priority 10?

Here's what docs state:
The priority of the notification. Specify one of the following values:
10–Send the push message immediately. Notifications with this priority
must trigger an alert, sound, or badge on the target device. It is an
error to use this priority for a push notification that contains only
the content-available key.
5—Send the push message at a time that takes into account power
considerations for the device. Notifications with this priority might
be grouped and delivered in bursts. They are throttled, and in some
cases are not delivered.
And about VoIP:
Instead of persistent connections, developers should use the PushKit
framework—APIs that allows an app to receive pushes (notifications
when data is available) from a remote server. Whenever a push is
received, the app is called to action. For example, a VoIP app could
display an alert when a call is received, and provide an option to
accept or reject the call. It could even begin taking precursory steps
to initiate the call, in the event the user decides to accept.
Do I understand correctly that apns-priority defines message queuing at APNS side, and VoIP push type defines what happens on the device?
And what do they mean saying
It is an error to use this priority for a push notification that contains only the content-available key.
Will APNS return an error or is it just a bad practice?
P.S. I use AWS SNS for sending notifications and it does not support customisation of apns-priority, but I am curious how it affects the process.
The main difference is that even if your app is closed voip notification can wake your app for kill/suspended state and user notification just shows an alert without waking up your app for more refer.
Apple documentation for pushkit
The main difference is that VoIP notification will launch your app if it's not running or was killed from app switcher and you need to handle the notification in your code, while the normal notification will be shown immediately as local notification and will not start your app.

Quickblox Push Notifications are delayed

We use push notifications in our app. They work, but there's some variable delivery delay (sometimes ~10seconds, sometimes more than minute).
Does anybody know what to do to minimize those delays?
I know APNS has some delay, but I've never experienced such slow deliveries.
EDIT:
I digged out some time delay between message sent date and push created date.
I have message sent at 12:40:17 (according to QB's admin panel)
and push notification log for the same message says the the push is: "created_at":"2016-05-12T12:40:28Z"
Clearly we have 11 seconds difference between the time message is sent to QB and push notification being sent to APNS from QB
Push notifications are unreliable and cannot be guaranteed that they have been delivered. It all depends on the apple APNS server, that said, usually when I send a push notification I get the result in under a few seconds.
They are not reliable! ****There is no guarantee that push notifications will actually be delivered, even if the APNS server accepted them****.
As far as your server is concerned, push notifications are fire-and-forget; there is no way to find out what the status of a notification is after you’ve sent it to APNS. The delivery time may also vary, from seconds up to half an hour.
Also, the user’s iPhone may not be able to receive push notifications all the time. They could be on a WiFi network that does not allow connections to be made to APNS because the required ports are blocked. Or the phone could be turned off.
APNS will try to deliver the last notification it received for that device when it comes back online, but it will only try for a limited time. Once it times out, the push notification will be lost forever!
For what it's worth I am running into this issue too with Quickblox. The push notifications, a critical part of the communication flow, are delayed by up to a minute or so. I use push all the time in enterprise apps and yes, they should not be considered reliable, but in practice APNS communications are remarkably reliable and near instantaneous in my experience. It seems like Quickblox is queuing (throttling?) notification requests, my guess is to conserve bandwidth - aren't they based in Russia? It's spoiling what would otherwise be a great product.

iOS Push notification - not guaranteed

I have made a PushChatStarter app for Push Notification from this tutorial
http://www.raywenderlich.com/32963/apple-push-notification-services-in-ios-6-tutorial-part-2
But I find that only some of the messages are being successfully sent. It is mentioned in the tutorial that the push notifications are not guaranteed. I would like to know the reason why this is happening.
I could not understand the solution mentioned in that tutorial. Could anyone explain how to obtain the solution. I would like to know how to make the application reliable.
I found the answer here: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/WhatAreRemoteNotif.html
Quality of Service
Apple Push Notification Service includes a default Quality of Service (QoS) component that
performs a store-and-forward function. If APNs attempts to deliver a notification but the device
is offline, the QoS stores the notification. It retains only one notification per application
on a device: the last notification received from a provider for that application.
When the offline device later reconnects, the QoS forwards the stored notification to the device.
The QoS retains a notification for a limited period before deleting it.

Can an iOS push notification selectively replace a prior notification?

I am using iOS push notifications. In Android you can set up to 4 notification keys and then using these keys you can have notifications replace prior notifications if they have not yet been read/seen by the user.
Do iOS push notifications also allow you to selectively replace prior notifications? (E.g. using a common notification key) or do they always "rack up" and cannot be replaced.
Link: Local and Push Notification Programming Guide:
Quality of Service
Apple Push Notification service includes a default Quality of Service
(QoS) component that performs a store-and-forward function.
If APNs attempts to deliver a notification but the device is offline,
the notification is stored for a limited period of time, and delivered
to the device when it becomes available.
Only one recent notification for a particular application is stored.
If multiple notifications are sent while the device is offline, each
new notification causes the prior notification to be discarded. This
behavior of keeping only the newest notification is referred to as
coalescing notifications.
If the device remains offline for a long time, any notifications that
were being stored for it are discarded.
There's no such mechanism in place in iOS.
After sending a push notification you have no control over it anymore.

Sending 10000+ push notifications but not all devices receive it

For our iOS news apps we send out more than 10000 push notifications to registered devices, but somehow not all devices seem to receive the notification. We have been doing this for years but recently we received user feedback stating they did not receive a push notification while they did register their device to receive them.
Our logs show that these specific devices registered successfully and that there were no errors sending the push notification, but somehow the APNS does not deliver the notification. We have seen that removing the app from the device and reinstalling it sometimes solves the problem but we are still concerned.
We think it must be Apple's service that fails to deliver the push notification sometimes, especially when it comes to sending large amounts of notifications. Any of you experienced this?
The Apple docs says this:
Important: Delivery of notifications is a “best effort”, not
guaranteed.
Have you checked the payload size? As per Apple's documentation, the maximum size allowed for a notification payload is 256 bytes.

Resources