Search code examples
iphoneapple-push-notificationsapns-sharp

iPhone: Push notification reliability on bulk devices


I have been using https://github.com/Redth/APNS-Sharp to send push notification message to all devices where my iPhone App installed. It's working very inconsistent way!

How does this issue started?

We have an iPhone App with around 500 users. We noticed that most of users are not receiving notification message! Further debugging on real time, I have noticed following sequence of events.

.....
10:37:33 AM - Notification Queued!
10:37:33 AM - Notification Queued!
10:37:33 AM - Notification Queued!
10:37:33 AM - Notification Queued!
10:37:36 - Connecting...
10:37:36 - Connected...
10:37:36 - Notification Success
10:37:36 - Notification Success
10:37:36 - Notification Success
...
10:37:36 - Error: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.
10:37:39 - Connecting...
10:37:40 - Connected...
10:37:40 - Notification Success
10:37:40 - Notification Success
....

What I have done?

I have created testing iPhone App using Ad-Hoc production certificate and installed it on 5 devices. I tried sending multiple messages at the same time to all these devices. I noticed totally inconsistent behaviour in receiving messages. Sometimes all 5 devices received message instantly. Out of 5, 3 devices receive message almost instantly, and out of other two devices, either of them receive message instantly sometimes and other doesn't receive all messages but the last message. Sometimes it doesn't receive message at all!

I also tried sending message to individual device at a time and noticed that once it has started receiving the message then all message comes instantly and sometimes just receive last message after long duration(about 20 minutes).

What I have verified?

  • It uses the same connection to send all messages so it doesn't open multiple connections.
  • Using the correct certificate and push notification server.
  • Ran Feedback service few times but it didn't return any device IDs.

Does anyone else noticed this behaviour? What could be issue when you send message to multiple devices? Is there anything else I could do to make Push notification reliable?

Thanks.


Solution

  • I have logged this bug to Apple and got response from them. It seems they have fixed client side things related to Push Notifications in iOS 5.0. Also as Push Notification is not guaranteed, this inconsistent behavior has been happening. If someone interested then Bug ID# 10333505