Determine if Internet Connection Available
Be careful with your logic when using
This tells you if any network is available…which doesn’t necessarily mean that you can connect to the internet!
For example if in my app if I unplug my network cable the method returns false…until I plug in my mobile device and suddenly (and accurately) it returns true. Plugging my mobile in does not mean I have internet access BUT IT MIGHT.
The best way to check for an internet ready connection is to make some call out to the internet and see what happens, there’s a few suggestions for which approach, I like this one:-