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:
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?
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.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With