Push notifications (iPhone) give “111 Connection refused”

前端 未结 3 592
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-13 04:51

When I try to send Push Notifications I get this error: \"Connection refused\", but I don\'t know why... I\'ve uploaded my apns-dev.pem in the same directory as well in the

相关标签:
3条回答
  • 2021-01-13 05:29

    I've know fixed that error by adding this: STREAM_CLIENT_ASYNC_CONNECT|STREAM_CLIENT_CONNECT

    Know I'm not getting any errors, but I don't receive any notification. I think the Dev-token is not valid know, so, this is how it look like

    numbers numbers numbers numbers numbers numbers numbers numbers.

    The spaces are removed in this line: $apnsMessage = chr(0) . chr(0) . chr(32) . pack('H*', str_replace(' ', '', $deviceToken)) . chr(0) . chr(strlen($payload)) . $payload;

    Edit: I founded the problem: My server is refusing the outgoing port, just sent a mail, hoping they can activate it...

    0 讨论(0)
  • 2021-01-13 05:42

    You don't want a passphrase unless your .pem file requires one. The connection requires peer verification (option verify_peer) turned on. Also, make sure $apnsCert is the valid path to the certificate, you can use an absolute path as a sanity check.

    Lastly, this shouldn't effect your ability to connect, but your device token needs to be valid.

    0 讨论(0)
  • 2021-01-13 05:48

    Make sure the outgoing port 2195 is open.This would be in your firewall config.

    0 讨论(0)
提交回复
热议问题