Is there a way to detect online connection?


#1

I’d need to know how to detect if there is a online connection. My app is going to be offline but if there’s a connection in the start I want to do something else.


#2

Check the API that you app wrapper is going to be in. I would have thought something would be there. Otherwise, you can just check if you can access a known site like Google: https://stackoverflow.com/questions/5224197/javascript-check-if-server-is-online

Or some other ways: https://davidwalsh.name/detecting-online