immobiliare / ApnsPHP

ApnsPHP: Apple Push Notification & Feedback Provider
BSD 3-Clause "New" or "Revised" License
1.44k stars 452 forks source link

Passbook. Trouble with push-notification #109

Open DarkVss opened 8 years ago

DarkVss commented 8 years ago

When I send a push, gives the following:

   Thu, 19 Nov 2015 14:24:53 +0300 ApnsPHP[5908]: INFO: Trying tls://gateway.push.apple.com:2195... 
Warning: stream_socket_client(): Unable to set verify locations `./entrust_2048_ca.cer' `(null)' in C:\OpenServer\domains\stas\darkvss\vendor\ApnsPHP\Abstract.php on line 394

Warning: stream_socket_client(): failed to create an SSL handle in C:\OpenServer\domains\stas\darkvss\vendor\ApnsPHP\Abstract.php on line 394

Warning: stream_socket_client(): Failed to enable crypto in C:\OpenServer\domains\stas\darkvss\vendor\ApnsPHP\Abstract.php on line 394

Warning: stream_socket_client(): unable to connect to tls://gateway.push.apple.com:2195 (Unknown error) in C:\OpenServer\domains\stas\darkvss\vendor\ApnsPHP\Abstract.php on line 394
Thu, 19 Nov 2015 14:24:53 +0300 ApnsPHP[5908]: ERROR: Unable to connect to 'tls://gateway.push.apple.com:2195': (0) Thu, 19 Nov 2015 14:24:53 +0300 ApnsPHP[5908]: INFO: Retry to connect (1/3)...

The code

require_once './vendor/ApnsPHP/Autoload.php';

$push = new ApnsPHP_Push(
    ApnsPHP_Abstract::ENVIRONMENT_PRODUCTION,
    './cert.pem'
);
$push->setProviderCertificatePassphrase('pass_for_cert');
$push->setRootCertificationAuthority('./entrust_2048_ca.cer');
$push->connect();
$message = new ApnsPHP_Message('87d0ef0518*******25c99d234ebc14b11820');
$message->setCustomIdentifier("Message-Badge-3");
$message->setText('');
$message->setSound();
$message->setExpiry(30);
$push->add($message);
$push->send();
$push->disconnect();
$aErrorQueue = $push->getErrors();
if (!empty($aErrorQueue)) {
    var_dump($aErrorQueue);
}

How to solve a problem ? What can be a problem at all? For three days, I suffer with this problem = (

rajeevjaiswal commented 8 years ago

I am also having same issue