Send to iOS asks for pass phrase in console
nbastoWM opened this issue · comments
I have a Certificate with a pass phrase and when I use it it asks for pass phrase in the console:
Enter PEM pass phrase:
My configuration:
'apn' => [
'certificate' => __DIR__ . '/iosCertificates/certificate2.pem',
'passPhrase' => '1234', //Optional
// 'passFile' => __DIR__ . '/iosCertificates/yourKey.pem', //Optional
'dry_run' => true
]
My code:
$push = new PushNotification('apn');
$push->setMessage([
'aps' => [
'alert' => [
'title' => $data['title'],
'body' => $data['description']
],
'sound' => 'default'
],
'extraPayLoad' => [
'type' => $data['type'],
'id' => $data['id'],
]
])
->setDevicesToken([$devicetoken])
->send();
After writing 1234 in the console it sends the notification. Am I missing something?
That's weird.
Could you send by mail that certificate and a device token so that I can try to replicate the issue?
mail id: edujugon@gmail.com
Ok. I found out the problem was the certificate conversion from p12 to pem.
First I was using the command line to do it but then I tried an online converter and it worked fine.
Can you tell me the right way to convert those certificates to PEM files?
Thank you.
I'm glad to know you solved the issue.
In regard to convert certificates to PEM files, have a look at this: pem and let me know if it was useful.
After your update, I'm closing this issue since it was solved.