APNS (Apple Push Notification Service) reliability

青春壹個敷衍的年華 提交于 2019-11-26 19:55:32
  1. APNS is based on Apple Servers, and Apple doesn't give any guarantee on successful message delivery.
  2. If the app is open (i.e. the user is using the app) while the notification arrives, iOS doesnt show a notification message, you need to handle it.
  3. Notification shows up only when the app is backgrounded or killed.
  4. Also implement feedback service on your server side; will help you get rid of old unwanted tokens(users who deleted the app or disabled notifications thru settings).
  5. Dont send too many notifications to a device within a short span of time, coz APNS caches only 1 message/device (if the device is offline). So it can deliver the message when the device comes online. Am not sure how long the message is cached though.

Or just implement Pusher... http://pusher.com

We're facing the same problem. As everybody said, APNS is a best effort service so you can't be sure every notification will be delivered, but what you can do is to be sure of which ones have been received. This is what we're about to do. We register in our backend each notification que ship and the mobile app reports back each notification it receives. Then we set a maximum time of waiting for a notification to be received, if we don't receive the report back we try again.

I hope it might be helpful to someone (even 2 years later)

It says it quite clearly in the Apple Docs that it is not 100% gauranteed and nor should it be used as so. Its sent with "best effort".

As per Apple's guidelines, APNS is not 100% reliable service that means your app may not get the push notifications from Apple servers due to some of following reasons:

  • Device is offline
  • Your app is in the foreground state, you need to manage the push notification.

Note: Apple rejects app which makes compulsion using notification services. (I have faced it in one of my App)

For more information, you can look into this answer

https://stackoverflow.com/a/25830955/3278326

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!