Push Notifications stopped working after switching to Amazon ec2 server

I tested my iPad app with ad-hoc distributions.

On our server (running Windows Server 2008), APNS alerts go through a fine.

On ec2 (also running Windows Server 2008), they never come.

The only difference between the two special versions is the server they point to. Both have the same code signature settings.

I followed the same procedure to import certificates on both servers, and as far as I can tell, the certificates on both servers are the same.

I also opened ports 5223, 2196, 2195 and 443 and resolved the address block 17.0.0.0/8:

enter image description here

I even tried to disable the firewall, but without joy, and I still can’t understand why it works on one and not on the other.

Does anyone have any ideas?

-Edit -

I use MoonAPNS to handle sending notifications via the C # / ASP.Net web service. I don't know if that matters.

+4
source share
2 answers

It turned out that there was nothing special about Amazon ec2, but rather something that not only should have been obvious, but I also had a problem with this before.

I am using MoonAPNS and the problem was the first parameter on this line:

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

The true parameter tells MoonAPNS to send a notification to the Sandbox server.

false tells him to send to the production server.

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

Both are now false , and notifications finally go through ec2.

Thank you all for your efforts.

+2
source

Push notifications with EC2 work fine. Used / implemented in several applications. Here are a few things to check.

  • Do you get an error message when connecting to APN servers? Try using $ telnet gateway.push.apple.com 2195 . It works? Otherwise, you may need to make changes to the security group / open the necessary ports

  • If the server says that the message was sent successfully, but you did not receive it in the application, make sure that you check the mobileprovision and pem files that you use

Since you mention telnet works, and you checked pem and mobileprovisions, a few more things to check

  • Are there any errors when MoonAPNS tries to connect to APN servers?

  • If no errors were returned, did you check if the device tokens were stored in your database, and this was the token of the test device?

  • If messages are sent in order, did you ping feedback? Do they return an error for a specific device token (for example, your device)?

+5
source

All Articles