【发布时间】:2013-09-11 20:46:15
【问题描述】:
我正在尝试为网站实施新的Safari Push notification service。我一直使用demo template on github 作为起点。
什么有效: Safari 正确提示启用来自主机站点的通知 推送服务将设备 ID 正确记录到 mysql,并根据需要将其删除。 所以可以说最棘手的部分都可以。 我已经检查了demo test site 对我的工作是否完美。
我修改了演示代码以将数据推送到所有设备,而不是通过 id。再次,这似乎没问题。 但是触发推送通知不起作用。
我已验证服务器能够与 APNS 服务器通信
openssl s_client -connect gateway.push.apple.com:2195 -CAfile apns-cert.pem
其中 apns-cert.pem 是从 Apple 的 p12 文件转换而来的。
stream_socket_client 没有返回任何错误,我已经转储了发送的 json 数据的输出,看起来还可以:
"{"aps":{"alert":{"title":"Test notification","body":"This is a test push notification","action":"View"},"url-args":[""]}}"
额外问题 我是否需要从创建推送包的同一服务器发送推送通知,还是可以从任何地方发送,只要我有证书和设备 ID?
【问题讨论】:
标签: php safari apple-push-notifications