php - iOS APN Php 无法连接

标签 php ios swift push apn

我遵循了这个关于如何发送推送通知的 youtube 教程:https://www.youtube.com/watch?v=_3YlqWWnI6s

当我在我的网络服务器上运行 php 文件时,它超时并给我这个错误。我查看了网络,但我找不到任何问题,有人可以建议我哪里出错了..

[14-Dec-2015 06:13:10 America/New_York] PHP Warning:  stream_socket_client(): unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Connection timed out) in /home2/sptechno/public_html/Wink/sendPush.php on line 18

最佳答案

当你为 Apple 推送通知运行 .php 文件时。

那时你需要检查 TCP/UDP 端口号是否在你的服务器上打开,否则通知不会传递给苹果服务器。

General Provider Requirements

As a provider you communicate with Apple Push Notification service over a binary interface. This interface is a high-speed, high-capacity interface for providers; it uses a streaming TCP socket design in conjunction with binary content. The binary interface is asynchronous.

The binary interface of the production environment is available through gateway.push.apple.com, port 2195; the binary interface of the development environment is available through gateway.sandbox.push.apple.com, port 2195.

Apple official document for that.

已编辑

检查您的服务器是否已连接到 APNS。

HOSTGATOR:~ Home$ telnet gateway.sandbox.push.apple.com 2195

Trying 17.149.34.143...

Connected to gateway.sandbox.push-apple.com.akadns.net.

Escape character is '^]'.

关于php - iOS APN Php 无法连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34265634/

相关文章:

ios - 尝试在 Xcode 上运行 UI 测试时出现 "Module file was created by an older version of the compiler"消息

ios - 使用 Swift 以编程方式加载图像

php - 来自 PHP 结果的 jQuery json

php - 购物车表 - 反馈数据库设计

ios - 如何在 iOS (Ionic 2/3) 中下载文件?

ios - 方法签名返回值 "Class of type or subclass class"

android - 如何检查键值是字符串还是整数(ios,Android)

php - 多个测试在 phing 中发生冲突

php - Mongo获取id以某个数字结尾的用户

ios - swift + WKWebView : How to prevent visits to certain URLs?