Conversation
| } | ||
|
|
||
| protected function generateJwt() { | ||
| $key = openssl_pkey_get_private('file://'.$this->config['key']); |
There was a problem hiding this comment.
I would suggest to not access the file system here to avoid any complications at runtime for the following reasons:
- Directory structure can look different in other projects
- Certificates should be placed in Laravel's
/storagefolder and read from there usingstorage_path()helper
Suggestion: Could you move the openssl_pkey_get_private method into the config.php file and access it from the storage path?
There was a problem hiding this comment.
I was just following the folder structure that exists nowadays.
There is the iosCertificates folder right there, I didn't place the .p8 file into the folder because it wasn't technically a certificate, but there would be no problem placing it "by default" inside a new folder. This route can be set in the config anyway, in case another project has a different structure.
| 'dry_run' => true, | ||
| ], | ||
| 'apnp8' => [ | ||
| 'key' => __DIR__ . '/apns-key.p8', |
There was a problem hiding this comment.
openssl_pkey_get_private(storage_path('/apns-key.p8'))
Allow use of APNs keys (that doesn't expire) instead of certificates.
I added a new service, so it doesn't contain any breaking changes with the actual APN version with certificates.
All the user has to do is use the new service 'apnp8' and update the config needed for it.