Code Monkey home page Code Monkey logo

Comments (6)

manuel-rubio avatar manuel-rubio commented on May 23, 2024 1

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.

from apns4erl.

manuel-rubio avatar manuel-rubio commented on May 23, 2024

Yes, usually when the {error, closed} is immediately that should be because the certificate is not valid for Apple. Ensure the certificate is in the correct format (you should see only one BEGIN CERTIFICATE in the certificate file), and the key file is correct and if it's protected with password, you also have the password in the configuration.

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 openssl command:

openssl x509 -in file.pem -noout -dates

from apns4erl.

peffis avatar peffis commented on May 23, 2024

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:

  1. What does "Feedback server disconnected. Waiting 18000000 millis to connect again..." mean? I get this when it starts up. Is this because the app is only in development/TestFlight mode and there is no Feedback to be done by the Feedback server?

  2. When I send a message now with "apns:send_message(my_connection_name, MyDeviceToken, "Hello")." I get first a
    Sending msg <<"}²$/">> (expires on 1461998386)

and then...
Error trying to inform error (invalid_token) msg <<"}²$/">>: undef

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.

from apns4erl.

peffis avatar peffis commented on May 23, 2024

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...

from apns4erl.

peffis avatar peffis commented on May 23, 2024

...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.

from apns4erl.

ferigis avatar ferigis commented on May 23, 2024

I think we can close that ticket

from apns4erl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.