iOS - 这是生成APNS生产证书的正确流程吗?

LuZ*_*uZa 4 production certificate push-notification apple-push-notifications ios

这是生成PRODUCTION证书的正确流程吗?

openssl x509 -in aps_development.cer -inform der -out myCert.pem

openssl pkcs12 -nocerts -out myKey.pem -in myCert.p12

cat myCert.pem myKey.pem > my.pem
Run Code Online (Sandbox Code Playgroud)

.. 然后:

$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'local_cert', 'certificati/my.pem');
stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);

// Open a connection to the APNS server
$fp = stream_socket_client(
    'ssl://gateway.push.apple.com:2195', $err,
    $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);
Run Code Online (Sandbox Code Playgroud)

Luk*_*uke 7

是的,这一切对我来说都很好.

您可以根据以下优秀教程检查生产命令:

http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12

并且您连接到实时APNS服务器的PHP代码看起来同样有效.您可以将它与一些好的答案进行比较:

/sf/answers/577484071/

/sf/answers/667552021/

您还可以考虑将服务器地址切换到沙盒APNS服务器,测试所有代码,然后在准备好提交应用程序时将URL切换到实时服务器.

希望这可以帮助.