Skip to content
This repository has been archived by the owner on Jun 6, 2021. It is now read-only.

Can't manage to get IOS push notification working #60

Open
Maxwell2022 opened this issue Apr 11, 2014 · 6 comments
Open

Can't manage to get IOS push notification working #60

Maxwell2022 opened this issue Apr 11, 2014 · 6 comments

Comments

@Maxwell2022
Copy link

I think it's missing some documentation about iOS and how to generate the certificate and passphrase. I've followed a neat video that it's explaining how to do ti (for another service, but still the same process): https://www.youtube.com/watch?v=12yjIm0Z8Cw

  1. Generated CSR from keychain
  2. upload the CSR to apple developer and download the generated certificate
  3. Add this certificate to the keychain
  4. Export the certificate (as p.12 format) setting a passphrase
  5. Copy the exported certificate to the app folder (app/certificates for me)

Here is my configuration:

rms_push_notifications:
    android:
        gcm:
            api_key: xxxxxxx
            use_multi_curl: true # default is true
    ios:
        sandbox: true
        pem: "certificates/xxxx-apns-dev-cert.p12" # can be absolute or relative path (from app directory)
        passphrase: "xxxxx"

Now I have a p12 certification and the passphrase I've created. If I try to send a push notification I get the following error:

PHP Warning: stream_socket_client(): Unable to set local cert chain file `/var/www/xxxx/app/certificates/xxxxx-apns-dev-cert.p12'; Check that your cafile/capath settings include details of your certificate and its issuer in /var/www/xxxx/vendor/richsage/rms-push-notifications-bundle/RMS/PushNotificationsBundle/Service/OS/AppleNotification.php on line 196

@ZhukV
Copy link
Contributor

ZhukV commented Apr 11, 2014

Your must generate a *.pem file and set to configuration.

@Maxwell2022
Copy link
Author

Ok, looking at the configuration I think the bundle is waiting for a .pem certificate

To generate one from the .p12 I had, I did the following:
openssl pkcs12 -in zumny-apns-dev-cert.p12 -out zumny-apns-dev-cert.pem -nodes -clcerts

And update my config file to point to the .pem file:

rms_push_notifications:
    android:
        gcm:
            api_key: xxxxxxx
            use_multi_curl: true # default is true
    ios:
        sandbox: true
        pem: "certificates/xxxx-apns-dev-cert.pem" # can be absolute or relative path (from app directory)
        passphrase: "xxxxx"

And it's now working.
I think more documentation about this would be a great plus for the bundle ;)

Thanks everyone

@ZhukV
Copy link
Contributor

ZhukV commented Apr 11, 2014

http://stackoverflow.com/questions/21250510/generate-pem-file-used-to-setup-apple-push-notification

@Maxwell2022
Copy link
Author

yes, but having the doc at the same place than the bundle or at least linking the doc in the bundle would have saved me a lot of time ;)

@Maxwell2022
Copy link
Author

I'll submit a PR with documentation improvement ;)

@jnanendraveer
Copy link

Guys- This still pending?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants