Closed wcyyo closed 6 years ago
Hey. Not sure if there is a better way to use p12 files... if there is I hope someone can correct me. But I was able to get this to work by using my p12 file and cert. I'll try and do my best to explain the steps.
Place the p12 file and cert file on the desktop (make sure they are named cert.cer and key.p12.. if not rename them)
Cd into the desktop on terminal and run the following commands
openssl x509 -in cert.cer -inform DER -outform PEM -out cert.pem
openssl pkcs12 -in key.p12 -out key.pem -nodes
Move the PEM files into your server. ( I placed them in a certs directory)
Set the following as your config
apn: {
key: './certs/key.pem',
cert: './certs/cert.pem'
}
}
Use like so const push = new PushNotifications(config.pushNotifications)
Hope that helps!
Closing this for inactivity. Thanks for your help @Daadler6
Api said use p8 and team ID to config, but there is p12 file .Could i use this p12 file to certificate?