除非在 TestFlight 或 AppStore 上,否则推送通知不起作用

Push notifications not working unless it's on TestFlight or AppStore

我在开发推送通知方面遇到问题。我使用了 APN 测试器,这就是我在 return:

中得到的结果
Connected to server gateway.sandbox.push.apple.com  
Set SSL connection  
Set peer domain name gateway.sandbox.push.apple.com  
Keychain Opened  
Certificate  data  for Apple Push Services: com.boardinc.Board initialized successfully  
Failure creating sec identity, error code -25300  
Failure creating client certificate, error code -50  
Failure performing handshake, error code -9824  
Token: <0c6586f1 3933b8df 5da790a4 dd82e6c6 6cd7245e f27590c1 8c8ede44 53d8912d>  
Failed with sending data to gateway.sandbox.push.apple.com:2195 with ERROR: -9806, error code -9806  
Disconnected from server gateway.sandbox.push.apple.com:2195  

我似乎找不到没有创建安全身份的任何原因。

我尝试使用 Release 和 Debug 令牌执行此操作,结果相同。网关开发和 AdHoc/Production。没有成功。

现在,推送通知在 TestFlight 和 AppStore 上工作得很好。我不知道从哪里开始。有什么建议吗?

非常感谢。

所以如果你们中的任何人遇到同样的问题,解决方案如下: