gpt4 book ai didi

ios - 生产中的推送通知不起作用

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:58:52 25 4
gpt4 key购买 nike

我已经实现了this网址。

开发模式通知有效,但在生产中无效。并显示错误。

  dakshas-iMac:alootamatar daksha$ php push_demo.php

Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /Users/daksha/Desktop/alootamatar/push_demo.php on line 18

Warning: stream_socket_client(): unable to connect to ssl://gateway.push-apple.com:2195 (php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known) in /Users/daksha/Desktop/alootamatar/push_demo.php on line 18
Failed to connect: 0 php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known
iMac:alootamatar daksha$ php push_demo.php

Warning: stream_socket_client(): Unable to set private key file `/Users/daksha/Desktop/alootamatar/cert.pem' in /Users/daksha/Desktop/alootamatar/push_demo.php on line 18

Warning: stream_socket_client(): failed to create an SSL handle in /Users/daksha/Desktop/alootamatar/push_demo.php on line 18

Warning: stream_socket_client(): Failed to enable crypto in /Users/daksha/Desktop/alootamatar/push_demo.php on line 18

Warning: stream_socket_client(): unable to connect to ssl://gateway.push.apple.com:2195 (Unknown error) in /Users/daksha/Desktop/alootamatar/push_demo.php on line 18
Failed to connect: 0


After using APNS tester got response
2016-01-01 09:37:08 +0000: Set SSL connection
2016-01-01 09:37:08 +0000: Set peer domain name gateway.push.apple.com
2016-01-01 09:37:08 +0000: Keychain Opened
2016-01-01 09:37:08 +0000: Certificate data for Apple Production IOS Push Services: com.daksha.alootamatar initialized successfully
2016-01-01 09:37:08 +0000: Sec Identity created
2016-01-01 09:37:08 +0000: Client certificate created
2016-01-01 09:37:10 +0000: Connected
2016-01-01 09:37:10 +0000: Token: <f65ed342 4416c0bf e2a8c26a f3eb9a69 70780771 4eadb033 61ca8aec c28d454a>
2016-01-01 09:37:10 +0000: Written 92 bytes sending data to gateway.push.apple.com:2195

2016-01-01 09:37:10 +0000: Disconnected from server gateway.push.apple.com:2195

最佳答案

首先确保您在服务器上安装生产 APN 证书,而不是开发证书。

之后确保您将通知发送到正确的服务器 URL

  • 沙盒:gateway.sandbox.push.apple.com,端口 2195。 (为了发展)
  • 生产:gateway.push.apple.com,端口 2195。 (发布)

你还是有同样的问题,试试这个应用程序。 APN Tester

关于ios - 生产中的推送通知不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34554680/

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