gpt4 book ai didi

php - iOS APN Php 无法连接

转载 作者:行者123 更新时间:2023-11-28 06:53:43 25 4
gpt4 key购买 nike

我遵循了这个关于如何发送推送通知的 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 serviceover a binary interface. This interface is a high-speed, high-capacityinterface for providers; it uses a streaming TCP socket design inconjunction with binary content. The binary interface is asynchronous.

The binary interface of the production environment is availablethrough gateway.push.apple.com, port 2195; the binary interface of thedevelopment environment is available throughgateway.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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com