My php script always giving error code 0 for apple push notification. The code which i used is given below
$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'passphrase', '');
stream_context_set_option($ctx, 'ssl', 'local_cert', 'TxxxProd.pem'); //TxxxDev.pem
$fp = stream_socket_client('ssl://gateway.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT, $ctx);
stream_set_blocking ($fp, 0);
$err
always returns 0
What we have modified on the server is we have upgraded php
version and ssl
certificate is renewed.
Current php version is PHP Version 5.6.29
Since the code works before, I can't find it out why it is not working now. As a beginner, I am not aware of the .pem
file in the server ?
Do we need to make some modifications on that .pem
file?
Try this,