I am facing issue with APNS php code for push notification on IOS devices, I have two separate connection for Development and Production.
Url: 'ssl://gateway.sandbox.push.apple.com:2195'
$push = new ApnsPHP_Push(
ApnsPHP_Abstract::ENVIRONMENT_SANDBOX,
'APNS_Dev_ISAS.pem'
);
$myNewLogger = new MyNewLogger();
$push->setLogger($myNewLogger);
// Set the Provider Certificate passphrase
$push->setProviderCertificatePassphrase('1234567');
$push->setRootCertificationAuthority('APNS_Dev_ISAS.pem');
$push->connect();
Issue:
Url: ssl://gateway.push.apple.com:2195
$push = new ApnsPHP_Push(
ApnsPHP_Abstract::ENVIRONMENT_PRODUCTION,
'APNS_PROD_ISAS.pem'
);
$myNewLogger = new MyNewLogger();
$push->setLogger($myNewLogger);
// Set the Provider Certificate passphrase
$push->setProviderCertificatePassphrase('12345678');
$push->setRootCertificationAuthority('APNS_PROD_ISAS.pem');
$push->connect();
Error of connection: INFO: Trying ssl://gateway.push.apple.com:2195...ERROR: Unable to connect to 'ssl://gateway.push.apple.com:2195': (0) INFO: Retry to connect (1/3)...INFO: Trying ssl://gateway.push.apple.com:2195...ERROR: Unable to connect to 'ssl://gateway.push.apple.com:2195': (0) INFO: Retry to connect (2/3)... INFO: Trying ssl://gateway.push.apple.com:2195...ERROR: Unable to connect to 'ssl://gateway.push.apple.com:2195': (0) INFO: Retry to connect (3/3)... INFO: Trying ssl://gateway.push.apple.com:2195...ERROR: Unable to connect to 'ssl://gateway.push.apple.com:2195': (0)
I google the issue and I found the some solutions and I have check all and everything is fine but no success.
Any help will be appreciated really. Thanks in advance.
Certificate (.pem) having issue that I was created for push notification.
Solution: After few days trying on same issue I found that create certificate with mini character passpharess may be 1234, It will work perfect for you and make successful connection to IOS push notification server.
May be this will help someone else.
Thanks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With