-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{error, closed} in apns:connect and general cluelessness on my behalf #103
Comments
Yes, usually when the Ensure also you are connecting to the correct domain, depending on if it's the test env or the prod env. And finally even one check for dates with
|
Yes, it was the certificate. I regenerated the files and now it connects. Now it seems to connect at least although I don't get the message through :) Two questions:
and then... Does this mean that Apple thinks that the device token is invalid? The token IS the one reported from the phone - a 64 character string of hex characters. Or does it mean that something else is wrong? The "undef" in the error message seems to indicate some internal problem somewhere. |
The "undef" part was because of my own fault (I had not started lager which I used in the error callback function). Now it says: APNS disconnected08:52:54.298 [error] error: <<128,198,67,89>> - invalid_token So the device token seems to be bad somehow, right? I wonder why that is... |
...ok, so if anyone finds this because they were having similar problems, I will document here that the problem with the invalid token was because the app was signed with a different key (the distribution key) and my push service was communicating with the development sandbox. I rebuilt the app with the right key and then got a different device token...a token that worked. I will stop showing my ignorance when it comes to all the certificate/profile issues on this thread now. I promise :) (although, to be fair, I do think apple has made it quite messy, and xcode is not the reliable friend for this always). Sorry to bother you guys. Thanks for the code. |
don't worry peffis... about this message: Feedback server disconnected. Waiting 18000000 millis to connect again... That's because APNS has the possibility to give you feedback about the devices uninstalled. This library opens that feedback channel every 18000000 millis (you can change the frequency in the configuration), retrieves information if there are something and calls the callback you provide it for every chunk of information. |
I think we can close that ticket |
Hi,
When I do apns:connect I get an {error, closed} back in return. What is the recommended way of finding out why this happens? I do not see any logs anywhere and I see nothing on the console.
Also, I suspect this is due to some problems with my certificates - an area which I am in general a bit clueless about at the moment and I find it a bit complex. Is there some documentation on how the cert_file and key_file used in apns4erl relates to the Apple certificates (the developer certificate and the push notification certificates) or any good documentation on how to set it up? I have for instance both an aps.cer and aps_development.cer and I understand I should generate a .pem file to input to apns4erl. Which .p12 file should I combine with the .cer to generate the cert_file .pem and which files should I combine to generate the key_file .pem? In your example sys.config you leave the key_file as "undefined" but I really need to specify a keyfile don't I?
/Stefan
The text was updated successfully, but these errors were encountered: