1

I'm trying to send ios notification with laravel (use laravel-push-notification) but I get this error:
Unable to connect: tls://gateway.sandbox.push.apple.com:2195: 2 (stream_socket_client(): Unable to set private key file /certificate/path.pem)
Here is my config:
'appNameIOS' => array( 'environment' =>'development', 'certificate' =>'../path.pem', 'passPhrase' => 'passPhrase', 'service' =>'apns' ),

But after I remove the quotes from passPhrase I just getting HTTP error 500 without any error on response body.

I created .pem files from this site step by step.

NOTE: I'm using MAMP server.

Hamid
  • 1,948
  • 4
  • 25
  • 38
  • 1
    Most likely your path to 'certificate' in not correct. I would debug that. – Angad Dubey Apr 10 '16 at 01:39
  • @AngadDubey I enter the certificate path correct in my app. Because if I insert wrong path I get `Certificate ../../PushCert.pem does not exist`. NOTE: I edited the sample path in my question. – Hamid Apr 10 '16 at 04:49

1 Answers1

2

I think that the pem certificate was not created correctly. Be sure to export both the private and public key together from the p12 keychain element. Follow indications here.

Community
  • 1
  • 1
valfer
  • 3,545
  • 2
  • 19
  • 24
  • Yes. I created pem file again and everything is ok, but I have another problem. When I send notification, `$push->getFeedback();` return empty array. How can I track notification. How can I know the notification was sent or not or if a problem occurs? – Hamid Apr 10 '16 at 16:39