Edujugon / PushNotification

PHP and Laravel Package to send push notifications to Android and IOS devices.
MIT License
479 stars 155 forks source link

.pem certificate and key not working with this package #90

Open annethereshewent opened 4 years ago

annethereshewent commented 4 years ago

So I'm using this guide https://github.com/Edujugon/PushNotification/wiki/APNS-Certificate to generate a pem file with both a cert and key, however it's not working. I get the following error:

Connection problem: stream_socket_client(): Unable to set private key file `/var/www/push-server/storage/certificates/apns-dev.pem'

Is there something I'm doing wrong? I noticed that there's no public keys in that file, only private keys. Is that an issue?

annethereshewent commented 4 years ago

update: the certificate generated by the instructions works if i do a manual curl request to the apple push server. something funky is going on with this package.

IllesAprod commented 4 years ago

experiencing same issue here.

IllesAprod commented 4 years ago

@annethereshewent I have found out, that you have to export your certificate from keychain as .p12 (it is only available if you select 'My certificates' in the sidebar) than you have to convert it with terminal:

openssl pkcs12 -in yourcert.p12 -out yourcert.pem -nodes -clcerts

Than your .pem is created, and working with this package!

Hope it helps!