views:

16

answers:

2

I have had push notifications setup for about a year now and they have been working fine. Now for some reason they are not.

First let me say that I am connections to apples apns servers and sending the push notifications via a PHP script.

If I test sending a notification just to my device, it works every time. If I test sending a notification to 3 or 4 of the devices I have here, they all work like they should. If I send a notification to all users (couple hundred) sometimes I will get the notifications and most of the time I wont.

I am connecting to apple once and sending all the notifications from the one connection. So it should not be an issue of apples connection limits.

Is there a limit that would not allow you to send to a couple hundred users?

Its a couple hundred users, the notifications only get sent out maybe once or twice a week. I have tried setting a time delay between each message but that didn't seem to make a difference.

does anyone have any ideas what could be happening or what I should check?

A: 

Are you doing any error checking? Are you using the "simple" or "extended" format? Are you parsing the result of the extended format? How long do you wait for the notifications to be received? Do you detect when Apple closes the connection? Do you check the feedback service?

I don't think you're supposed use a (short-lived) PHP script. Apple doesn't seem to send you anything on a successful notification, and there's not really another easy way to ensure that data has been received (and processed) by the other side of the connection.

It's also worth checking that you comply with the iOS Developer Program Licence Agreement Push Notification requirements on page 22 (no direct marketing, no excessive use).

tc.
A: 

OK, I got it all sorted out. It was on my servers end, I had a cron job that was not running the php script correctly after fixing that everything started working, no need to change anything in my PHP scripts.

MikesTooLz