apple push notification limitation - ios

I'm wondering if there is a limit to the number of apple push notifications we can send to users at once?
Can I send 100,000 push notifications at once using the APNS service?

If you are sending multiple notifications to the same device within a short period of time, the push service will send only the last one.
https://developer.apple.com/library/content/technotes/tn2265/_index.html#//apple_ref/doc/uid/DTS40010376-CH1-TNTAG23
Look "Some Notifications Received, but Not All" in that documentation.

Apple's Tech Note was recently updated to address this question :
There are no caps or batch size limits for using APNs. The iOS 6.1
press release stated that APNs has sent over 4 trillion push
notifications since it was established. It was announced at WWDC 2012
that APNs is sending 7 billion notifications daily.
If you're seeing throughput lower than 9,000 notifications per second,
your server might benefit from improved error handling logic.

There's no limit on how much notification you can send to Apple APNS server but reminder to avoid using allot of connection because Apple may ban your IP if he think you are doing a DDOS attack.
Also if a user is offline (iPhone out of signal) only the latest push notification will be in saved in apple's APNS server

Yes, you can!
You can also use 20 connections max for the sending of data.

Related

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.

Send Multiple Push Notifications to iOS users

Is it possible to send multiple (10 - 15) notifications to the registered iOS users at a time / instantaneously ? What are the limitations for iOS Push Notifications ?
Is it possible to send multiple (10 - 15) notifications to the registered iOS users at a time / instantaneously ?
No you can not send 10-15 notification simultaneously to same user, read more here at apple docs .
If you are sending multiple notifications to the same device or
computer within a short period of time, the push service will send
only the last one.
However if you intend to send push notifications to different users at same time than it should be no problem (Which i guess is what you are looking for).
What are the limitations for iOS Push Notifications ?
If you are not sending them simuntanously to same user than there is no limitation for APN's push notification as mentioned here .Take a look at Push Notification Throughput and Error Checking
There are no caps or batch size limits for using APNs. The iOS 6.1
press release stated that APNs has sent over 4 trillion push
notifications since it was established. It was announced at WWDC 2012
that APNs is sending 7 billion notifications daily.
If you're seeing throughput lower than 9,000 notifications per second,
your server might benefit from improved error handling logic.
Here's how to check for errors when using the enhanced notification
format. Keep writing until a write fails. If the stream is ready for
writing again, resend the notification and keep going. If the stream
isn't ready for writing, see if the stream is available for reading.
If it is, read everything available from the stream. If you get zero
bytes back, the connection was closed because of an error such as an
invalid command byte or other parsing error. If you get six bytes
back, that's an error response that you can check for the response
code and the ID of the notification that caused the error. You'll need
to send every notification following that one again.
Once everything has been sent, do one last check for an error
response.
It can take a while for the dropped connection to make its way from
APNs back to your server just because of normal latency. It's possible
to send over 500 notifications before a write fails because of the
connection being dropped. Around 1,700 notifications writes can fail
just because the pipe is full, so just retry in that case once the
stream is ready for writing again.
Hope this helps.
If you are sending multiple notifications to the same device or computer within a short period of time, the push service will send only the last one.
Here's why. The device or computer acknowledges receipt of each notification. Until the push service receives that acknowledgment, it can only assume that the device or computer has gone off-line for some reason and stores the notification in the quality of service (QoS) queue for future redelivery. The round-trip network latency here is of course a major factor.
As described in the Local and Push Notification Programming Guide, the QoS queue holds a single notification per app per device or computer. If the service receives another notification before the one in the queue is sent, the new notification overwrites the previous one.
All of this points out that the intent is that a notification indicates to an app that something of interest has changed on the provider, and the app should check in with the provider to get the details. Notifications should not contain data which isn't also available elsewhere, and they should also not be stateful.
Any push notification that isn't delivered immediately was queued for future redelivery because your device was not connected to the service. "Immediately" of course needs to take latency for your connection into account. Outlying cases would be beyond 60 seconds as APNs will time out at that point.
for more info click here

Is Apple Push notification using APNS free of cost?

We are planning to develop the push notification service for a telecom operator. But I haven't got any information whether the APNS push service is free of cost or should we make any payment?
My questions are,
Should I pay for using the APNS push service?
If operator want to sent push notification to millions of subscribers, should we pay to Apple or is it absolutely free? If not free, please share the URL where payment details are available.
Is there any limit for the number of notification sent or the number of subscribers?
Apple does not charge a separate fee for utilizing the push notification service.
Your only cost is a server that will be sending the push notifications to Apple. There are third-parties that provide this servers and there is a fee for that.
Answer for your question 1,2 and 3 is: Apple doesn't charge you for APNS - but you have to maintain a server for pushing.
Try these third parties for pushing,
PushWizard, a free and unlimited push service.
It can send 250 million push messages / hour
and PushWizard is free for unlimited devices, while other services can be very expensive if you have more, than 1 million users to reach at least ONCE per month.
Monopush, which provides a RESTful API and a lot of free push alerts up-front to handle the server infrastructure for you.
You need just copy and paste a few line codes to inside of your application and then magic will be started. After that you can start to watch, analyze, categorize your clients and you can send push messages to them as well as resource messages.
As mentioned above, Apple does not charge for the APNS
However, you need to maintain a 3rd party server for that, and sending notifications to millions of devices would require a lot of work from you.
There are some very good industrial solutions for iOS push notifications service that use APNS:
PushApps - free for 1M notifications per month, and unlimited notifications for 19.99 per month - here is the documentation
Urban Airship - free up to 1M notifications per month, afterwards you are charged per 1000 notifications
PushWoosh - free for 1M devices, premium plans are from 39 EURO
Diclaimer - I work in PushApps and also use their product in my applications for over a year now.
Please refer the following:
APNS is a free service. However, you need to maintain a server to send Push Messages.
Apple Local and Push Notification Programming Guide
There are many online servers which provide you free push services [for limited pushes/users/devices]. They do have plans depending upon the needs of client. Following are the few ones:
a. Parse Parse not available anymore. It is now acquired by Facebook. Read More Here
b. PushWizard
c. Xtify
d. SetUp your own push server - this tutroial comprise of complete end to end steps of how to send push messages to iOS Devices.
Hope this helps.
Although push notifications are usually send from 'servers', it is not necessary to own a server or to pay a service. Instead it is also possible to send pushes from your personal computer or mobile device. Especially for testing purposes, this is very useful. Try:
NWPusher
APNS-Pusher

APNS (Apple Push Notification Service) reliability

Our app uses APNS to receive Push Notifications. However, our client claims that some of their devices were not receiving notifications and argues to they 'must' make sure the notifications to be delivered 100%. But I have read somewhere that APNS is not 100% reliable and there should be cases which the notifications are not delivered.
I'm currently panic at how we could make sure APNS to received anytime. I have read that a case which may APNS not delivered (device may offline). But our test showing that even the device is online (Wifi or 3G), sometimes APNS were not delivered.
Is there any specific case which may APNS will not delivered? Or is there anything we (developers) can do with codes to make sure to receive all notifications? What I have done in the code is just registering the app to remote notification and write didRegisterForRemoteNotificationsWithDeviceToken, then throw the device token to our server.
Any help would be appreciated, for our client almost kill us if ALL of their devices not receiving APNS!
APNS is based on Apple Servers, and Apple doesn't give any guarantee on successful message delivery.
If the app is open (i.e. the user is using the app) while the notification arrives, iOS doesn't show a notification message, you need to handle it.
Notification shows up only when the app is backgrounded or killed.
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 through settings).
Don't send too many notifications to a device within a short span of time, because 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 which means your app may not get push notifications from Apple servers due to some of the following reasons:
Device is offline
Your app is in the foreground state, you need to manage the push notification.
Note: Apple rejects apps which make compulsion to use 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

Push Notification restrictions

Is there any limits/restrictions about amount of notifications sent to the APNS in time range?
For example - can I send 100,000 messages for 100,000 devices (one message for one device) in one hour to notify them about new content available to purchase via in-app purchases ?
Found nothing about any restrictions in the manual.
I don't think there is a restriction for number of messages sent in a time frame. But I guess in your case, it is unclear, if it violates rules stated in review guidelines 5.6 and 5.8
5.6 Apps cannot use Push Notifications to send advertising, promotions, or direct marketing of any kind
5.8 Apps that excessively use the network capacity or bandwidth of the APN service or unduly burden a device with Push Notifications will
be rejected

Resources