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

Sends the notification but hangs until execution time is expired #77

Open
german-chosen opened this issue Dec 17, 2014 · 1 comment
Open

Comments

@german-chosen
Copy link

Had the same problem with ZF2, thought that using this library would solve the problem. The thing is that I receive the notification, but the script just continue running. I occurs only sometimes.

This is what I got using the ApnsPHP library (got them in the log file):

INFO: Trying ssl://gateway.push.apple.com:2195...
INFO: Connected to ssl://gateway.push.apple.com:2195.
INFO: Sending messages queue, run #1: 1 message(s) left in queue.
STATUS: Sending message ID 1 custom identifier: bk-1418832690-57: 185 bytes.

This is what I got when using ZF2:

PHP Warning: fread(): SSL: Invalid argument in .../ZendService/Apple/Apns/Client/AbstractClient.php on line 156
PHP Fatal error: The request was aborted because it exceeded the maximum execution time. in .../ZendService/Apple/Apns/Client/AbstractClient.php on line 156

Update:

Maybe it's important. I couldn't manage how to use the Entrust Root Certification Authority, it failed when I tried to send a push notification.

Update:

Found a similar problem report in a forked repository. He proposed to use the following lines before using the $this->_hSocket:

$stream_meta_data=stream_get_meta_data($this->_hSocket);
if ($stream_meta_data['unread_bytes']<=0) { return; }

https://github.com/benguild/ApnsPHP/compare/duccio:master...master

@ishukshin
Copy link

My case was that script hanged only if it tried to get response of apns. You should just write to a stream\socket and close it.

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