Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amazing and Clean Code. Need your help #115

Open
samermg opened this issue Jan 18, 2016 · 1 comment
Open

Amazing and Clean Code. Need your help #115

samermg opened this issue Jan 18, 2016 · 1 comment

Comments

@samermg
Copy link

samermg commented Jan 18, 2016

Thank you for helping us. I never seen a clean code like this,

Im new to PHP, i followed the steps and got the following error while using push_simple_custom.php

//My configuration

// Instanciate a new ApnsPHP_Push object
$push = new ApnsPHP_Push(
ApnsPHP_Abstract::ENVIRONMENT_SANDBOX,
'ck_dev.pem'
);

// Set the Root Certificate Autority to verify the Apple remote peer
$push->setRootCertificationAuthority('ck_dev.pem');

// Connect to the Apple Push Notification Service
$push->connect();

// Instantiate a new Message with a single recipient
$message = new ApnsPHP_Message_Custom('32e42c9c903d11d2ddb3da3d5296adc51a7a2ea541d04c253bf7fd29fde627d9');

Error

Mon, 18 Jan 2016 20:25:04 +0100 ApnsPHP[1868]: INFO: Trying ssl://gateway.sandbox.push.apple.com:2195... Mon, 18 Jan 2016 20:25:04 +0100 ApnsPHP[1868]: ERROR: Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195': (0) Mon, 18 Jan 2016 20:25:04 +0100 ApnsPHP[1868]: INFO: Retry to connect (1/1)... Mon, 18 Jan 2016 20:25:05 +0100 ApnsPHP[1868]: INFO: Trying ssl://gateway.sandbox.push.apple.com:2195... Mon, 18 Jan 2016 20:25:05 +0100 ApnsPHP[1868]: ERROR: Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195': (0) Fatal error: Uncaught exception 'ApnsPHP_Exception' with message 'Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195': (0)' in /home/cwtappsc/public_html/WafeatPHP/ApnsPHP/Abstract.php:396 Stack trace: #0 /home/cwtappsc/public_html/WafeatPHP/ApnsPHP/Abstract.php(334): ApnsPHP_Abstract->_connect() #1 /home/cwtappsc/public_html/WafeatPHP/ApnsPHP/sample_push_custom.php(41): ApnsPHP_Abstract->connect() #2 {main} thrown in /home/cwtappsc/public_html/WafeatPHP/ApnsPHP/Abstract.php on line 396

@gaboh20
Copy link

gaboh20 commented Jan 6, 2017

As of Jan 2017 I had this problem. Turns out APNs url changed. Try with api.development.push.apple.com:443 for development and api.push.apple.com:443 for production. That worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants