Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending messages in bulk to APNS, what happens if there is an error with some of them?

Let's say I have 3 notifications to send - a, b and c - but there is a problem with notification b. Let's assume it is an invalid token. If I do the following:

  1. Create buffer
  2. Add a,b and c to buffer
  3. Send buffer to APNS server

Will message c be sent?

The Apple documentation says:

If you send a notification and APNs finds the notification malformed or otherwise unintelligible, it returns an error-response packet prior to disconnecting.

Does this mean that I would receive an error about b and the connection would be dropped, and therefore c would never be sent?

like image 507
Ryan Avatar asked Jun 01 '12 10:06

Ryan


People also ask

Are Apple push notifications guaranteed?

The system makes every attempt to deliver local and remote notifications in a timely manner, but delivery isn't guaranteed. The PushKit framework offers a more timely delivery mechanism for specific types of notifications, such as those VoIP and watchOS complications use. For more information, see PushKit.

How reliable is 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.

How does Apple's APN work?

Once you've completed setting up push notifications on your providers and in your app, your providers can send notification requests to APNs. APNs then delivers the notification to each targeted device. Once APNs receives a notification, the system delivers the notification to the appropriate app on the device.

What is payload in APNs?

Each notification your provider server sends to the Apple Push Notification service (APNs) includes a payload. The payload contains any custom data that you want to send to your app and includes information about how the system should notify the user.


1 Answers

Message c would never be sent. If you manage to receive the error response for message b, you have to resend all the messages you sent after sending b and before receiving the response.

You can read a good article about it here : The Problem with APNS

like image 137
Eran Avatar answered Sep 23 '22 02:09

Eran