Can't connect to production Apple Push Notification server

前提是你 提交于 2019-12-03 17:28:33
Marcelo

Yes, I've solved this error. I lost a few days finding the solution.

The problem is in the line:

result = SSLSetPeerDomainName(context, "gateway.sandbox.push.apple.com", 30); 

NSLog(@"SSLSetPeerDomainName(): %d", result);

You have to change the port to number 30. This solves the problem.

As the documentation said it exists 2 certificates and 2 IP address for the push notification:

  • Sandbox: gateway.sandbox.push.apple.com, port 2195. (for the development)
  • Production: gateway.push.apple.com, port 2195. (for the release)

You always use the gateway for the development. Try to use the other gateway (for the production).

For more information see here: Provisioning and Development

Similar problem was happening in our tests because we were trying to use developer device token instead of a production one.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!