0
votes

All,

I am trying to get Apple Push Notification working on Mac. But I am having below issue and need some help to figure out what is going on.

I have implemented the Push Notification sample from Worklight's Getting Started page. I am able to install the app on My iPhone 4S and able to subscribe to the Push notification. I can see one user and subscription in my Worklight Console. When I executed the adapter procedure to push the notification to my device, I see message saying message has been sent to user: XXX. However, I then see the following error message:

[WARNING ] Failed to send message com.notnoop.apns.EnhancedApnsNotification@30f6ea2a... trying again
[WARNING ] Failed to retreive invalid devices
[WARNING ] Failed to retreive invalid devices
[WARNING ] Failed to retreive invalid devices
[ERROR   ] Couldn't get feedback connection
[ERROR   ] Unknown exception: java.net.UnknownHostException: feedback.sandbox.push.apple.com
[WARNING ] Failed to retreive invalid devices
[WARNING ] Failed to retreive invalid devices
[WARNING ] Failed to retreive invalid devices
[ERROR   ] Couldn't get feedback connection
[ERROR   ] Unknown exception: java.net.UnknownHostException: feedback.sandbox.push.apple.com   

While googling to find out the solution for above issue, suggestions were that there could be some network issue. I turned off the firewall and was able to ping the APNS servers.

$ telnet 1-courier.push.apple.com 5223
Trying 17.149.32.15...
Connected to 1.courier-push-apple.com.akadns.net.
Escape character is '^]'.

$ telnet gateway.sandbox.push.apple.com 2195
Trying 17.149.34.65...
Connected to gateway.sandbox.push-apple.com.akadns.net.
Escape character is '^]'.

$ telnet gateway.push.apple.com 2195
Trying 17.172.233.147...
Connected to gateway.push-apple.com.akadns.net.
Escape character is '^]'.

I also tried to allow the below ports for APNS but no luck.

$ sudo ipfw add 0 allow tcp from any to any 2195
00100 allow ip from any to any proto tcp dst-port 2195
$ sudo ipfw add 0 allow tcp from any to any 5223
00200 allow tcp from any to any dst-port 5223
$ sudo ipfw add 0 allow tcp from any to any 2196
00300 allow tcp from any to any dst-port 2196
$ sudo ipfw add 0 allow tcp from any to any 443
00400 allow tcp from any to any dst-port 443

Worklight Version(Studio): V6.0 MacPro Configuration: Firewall is turned off Wi-fi Router: Firewall is turned off iPhone 4S: Notification is enabled in Settings

1

1 Answers

0
votes

It's not a matter of disabling your firewall... You can have it turned on, but make sure that the specific ports and IP address that belongs to Apple is allowed, as Apple suggests in this support document.