Search code examples
iosamazon-ec2windows-server-2008apple-push-notifications

Push Notifications stopped working after move to Amazon ec2 server


I've been testing my iPad app with ad-hoc distributions.

On our server (running Windows Server 2008) APNS alerts come through fine.

On the ec2 (also running Windows Server 2008) they never arrive.

The only difference between the two ad-hoc versions is the server they point to. Both have the same code-signing settings.

I followed the same procedure for importing certificates on both servers and as far I can tell the certificates are exactly the same on both servers.

I've also opened ports 5223, 2196, 2195 & 443 and allowed the 17.0.0.0/8 address block:

enter image description here

I even tried turning off the Firewall but no joy and I still can't figure out why it works on one but not the other.

Anyone have any ideas?

-EDIT-

I'm using MoonAPNS to handle sending the notifications via a C# / ASP.Net web service. Don't know if that makes any difference.


Solution

  • It turned out to be nothing specifically to do with the Amazon ec2 but rather something that not only should've been obvious but that I've also had an issue with before.

    I'm using MoonAPNS and the problem was the first parameter in this line:

    PushNotification push = new PushNotification(true, certificate, password);
    

    The true parameter tells MoonAPNS to send the notification to Apple's sandbox server.

    false tells it to send to the production server.

    I had false on our own server and true on the Amazon ec2.

    Both are now false and the notifications are at last coming through from the ec2.

    Thanks to everyone for your efforts.