Closed mehulkar closed 9 years ago
I've got a same problem. And, I reassign APN.certificate=File.read(APN.certificate) but, I've got
Errno::ENAMETOOLONG: File name too long @ rb_sysopen
How can I fix it?
@akihitotsuboi that sounds like a general Ruby issue. Perhaps the contents of your certificate file are too big? Or the filename is to long?
@mehulkar my problem was maybe different from users. I solved my issue like this. Thank you.
need passphrase when create .pem from .cer with passphrase, or need .pem without passphrase need to create .pem from .p12 from .cer
apn push token -c /path/ -m 'hello' -p
enter password
apn.certificate = File.read('/path')
apn.passphrase = 'password'
Fixed by 70e245f. Now if a valid certificate path is passed into APN_CERTIFICATE
, it will be read as expected. If that file does not exist, an exception will be raised.
@mattt does this warrant a patch update on rubygems? I try to be very specific about shipping dependency versions.
Thank you for the fix!
Yep. See version 2.2.2.
Thanks!
This might be an issue of better documentation, but as a first time user of houston and push notifications, I had the following problem:
I used dotenv to set the environment variable:
in an Rails initializer, I create the client, assuming that the env vars will be used automatically.
Now, when I open up rails console and try to send a push, I get this error.
Looking at the code, this seems obvious to me because
Houston::Client.development
, for example, sets thecertificate
accessor to the contents of the file, rather than the pathWhen I reassign
APN.certificate=File.read(APN.certificate)
, then it works.There are a few of solutions:
certificate_path
and on initialize, attempt to read that if@certificate
isnil
APN.certificate
ifFIle.exists? APN.certificate
istrue
either inClient#push
or inClient#new
Let me know if I've missed something obvious or if I'm completely wrong here.