Closed ky1ejs closed 7 years ago
Thank you for your input. From the docs:
:cert_path
: The path to a valid APNS push certificate in .pem or .p12 format, or any object that responds to :read.
Further down:
Note that since :cert_path can be any object that responds to :read, it is possible to pass in a certificate string directly by wrapping it up in a StringIO object:
Apnotic::Connection.new(cert_path: StringIO.new("pem cert as string"))
I understand that adding a little wrapper might be thought as unnecessary, but to me having an additional :cert
option can bring more confusion than benefits.
I have a use case where our token for APNS is stored in an ENV var, which of course means a file path can't be passed to Apnotic.
This change simply allows initialisation of Connection with a
:cert
string.