开发环境:
iOS 9.3.2(iPh6ne 6+)...但可在iOS 8.x上使用
Phonegap 6.2.7
Phonegap-plugin-push v1.7.2
PHP7(服务器端)-contentpush-参考
我的情况:
令牌已自动发送到我的服务器
消息已成功发送到ssl://gateway.push.apple.com 2195
设备没有收到任何警报,甚至没有警报(“”)
push.on('notification',function(data){console.log(data.message); alert(“”); alert(data.title +“消息:” + data.message);});
Apple不保证成功传递消息。你可以在这里看到相关的答案
如果在连接到网络时没有看到Apple推送通知,请与网络管理员联系以确保相关的TCP端口可访问。
要使用Apple Push Notification服务(APN),您的Mac和iOS客户端需要与Apple服务器的直接持久连接。
iOS设备尝试首先使用蜂窝数据连接到APN。如果设备无法通过蜂窝连接连接到Apple的服务器,则它将尝试使用Wi-Fi连接。
如果您在防火墙后面使用Wi-Fi或用于蜂窝数据的专用接入点名称(APN),则需要在以下端口上与APNs服务器建立直接,无代理的连接:
TCP port 5223: For communicating with Apple Push Notification services (APNs)
TCP port 2195: For sending notifications to APNs
TCP port 2196: For the APNs feedback service
TCP port 443: For a fallback on Wi-Fi only, when devices can't reach APNs on port 5223
APNs服务器使用负载平衡,因此您的设备将不会始终连接到相同的公用IP地址以进行通知。最好允许访问分配给Apple的整个17.0.0.0/8地址块上的这些端口。
APN代表Apple Push Notification服务。APN代表接入点名称,即蜂窝数据网络和Internet之间的网关。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句