network errors

Hi!

while waiting for answeres regarding friends and session logging issues I started looking into what happens if the user dosent have any internet connection. I get the error in the command line when running things in simulator… but the authlistener never gets fired when trying to login and it dosent show any errors there.

So my question is, how do I tell the user they need to check their internet connection and try again when I cant log them in because of this?

There are several strategies. For iOS devices we have a network detection API. Look up the networkStatus API calls in the documentation. The other strategy involves either using the socket.htto library or network request to try and connect to a site that ins always up like google and see if you can connect or not. There should be several examples in the community code.

ok thanks! Was just thinking if there was a way to show the feedback corona cloud is giving? since it is saying it cant connect because of a network error, but the authlistener is never fired showing the error, only shown in the terminal. Is there something one can add here or is the only way to do it as you described?

If an API call fails it should return something in the event table to tell you it failed. I don’t have the code in front of me so I can’t look up the specifics.

There are several strategies. For iOS devices we have a network detection API. Look up the networkStatus API calls in the documentation. The other strategy involves either using the socket.htto library or network request to try and connect to a site that ins always up like google and see if you can connect or not. There should be several examples in the community code.

ok thanks! Was just thinking if there was a way to show the feedback corona cloud is giving? since it is saying it cant connect because of a network error, but the authlistener is never fired showing the error, only shown in the terminal. Is there something one can add here or is the only way to do it as you described?

If an API call fails it should return something in the event table to tell you it failed. I don’t have the code in front of me so I can’t look up the specifics.