0

I am having some problems with apn, using simple format. This is the scenario:

1) I have a persistent connection to apn push service.

2) I send in a row 10 messages, where for example the 5th can have wrong device token

3) All messages from 1 to 4 are sent correctly

4) I receive a message from the socket of successful sending for all messages (included the ones from 5th to 10th).

5) message from 6th to 10th are not pushed to users.

6) after a while connection is closed by apn server

am i doing something wrong or is this the common behavior?

Eran
  • 387,369
  • 54
  • 702
  • 768
user601836
  • 3,215
  • 4
  • 38
  • 48

1 Answers1

0

What are you using to send push notification? Can you share your code? I have been using APNS-Sharp since long and it has been working absolutely fine. If 5th message has bad token is totally independent of next message! Make sure that you run Feedback service regularly and remove invalid tokens and the tokens doesn't want to accept your push notification. Also have a look at PushSharp.

Paresh Masani
  • 7,474
  • 12
  • 73
  • 139
  • i think the answer to this question could be good for me as well: http://stackoverflow.com/questions/1759101/multiple-iphone-apn-messages-single-connection?rq=1 what do you think? – user601836 Sep 18 '12 at 15:04
  • hmm I am not sure Apple immediately closes connection on first message or device token corrupted. It does it when you keep doing the same thing. Not sure but I read this on Apple's push notification document. Check if you are getting connection dropped after sending invalid device token. If it does dropped the connection then I will need to re-check my implementation! I had an issue while sending to bulk devices but it's works fine now. We do run feedback services regularly and removes the invalid tokens from database. – Paresh Masani Sep 18 '12 at 15:21
  • yeah, i also implemented feedback...but that is not bullet proof – user601836 Sep 18 '12 at 15:52
  • Did you resolve the issue? Can you put what's the end outcome please. It would be helpful for others like us. Thanks. – Paresh Masani Sep 27 '12 at 14:10
  • i have no clear proof for that but for my personal experience and for some web site i found around, apple seems to ignore all messages which arrive after the one with wrong token. Strangely if the json is longer than the limit imposed by apn, the messages are sent and the connections remains active – user601836 Sep 27 '12 at 14:20