As we dont have the game center lib , I will have to use a server to store all the players scores. But if the user does not have an internet connection i will skip the score upload step. So how can i basicly check if the user is connected to internet. I wanted to use inetwork and getmyip method and check if the ip is other than 127.0.0.1 but sometimes the ip address is 192.168.x.x for example and also there is no internet connection. So what is the simplest way to check if the user is connected to internet ?
I know that there are arguments for and against using ping as a method of verifying internet connectivity but I would like to use that approach for the situation that I experiencing.
Could anyone help by providing some code that implements the simple ping facility described here?
Yes I know that. The scenario that I am using is different from what you describe however. I'm wanting to check if access to a website that my app may not have visited before is likely to succeed. It is not my server.
One case I want to address is where the user is using my app while mobile and may need to log in to a wifi hotspot before the connection will succeed.
a page fetch will do then. you can work with job.success status and check for a keyword in the job.response text to be sure that the request was 100% successful
a page fetch will do then. you can work with job.success status and check for a keyword in the job.response text to be sure that the request was 100% successful
You seem to be of the opinion that it would be better for the user to wait 15 secs for the response to time out, rather than to do a 1 second check on basic connectivity beforehand.
OK thats your opinion, now can anyone help me with what I requested in the first place.