所有
我正在努力让Apple Push Notification在Mac上运行。但我有以下问题,需要一些帮助来弄清楚发生了什么。
我已经从Worklight的“入门”页面实现了推送通知示例。我可以在My iPhone 4S上安装该应用程序并能够订阅推送通知。我可以在Worklight Console中看到一个用户和订阅。当我执行适配器程序将通知推送到我的设备时,我看到消息说消息已发送给用户:XXX。但是,我看到以下错误消息:
[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
在谷歌搜索找出上述问题的解决方案时,建议可能存在一些网络问题。我关闭了防火墙并能够ping通APNS服务器。
$ 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 '^]'.
我还试图允许以下端口用于APNS,但没有运气。
$ 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版本(Studio):V6.0 MacPro配置:防火墙已关闭 Wi-Fi路由器:防火墙已关闭 iPhone 4S:在设置
中启用了通知答案 0 :(得分:0)
这不是禁用防火墙的问题......您可以将其打开,但要确保允许属于Apple的特定端口和IP地址as Apple suggests in this support document。