Edujugon / PushNotification

PHP and Laravel Package to send push notifications to Android and IOS devices.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

.pem certificate and key not working with this package

annethereshewent opened this issue · comments

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?

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.

experiencing same issue here.

@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!