ios - How Application will get to know Availability of internet connection in iPhone? -


i new iphone app development having couple of questions. me out on this.

1) how, application on iphone know that, there internet connection available when user switches on wifi button or cellular button in settings?

2) how differentiated between wifi connection , cellular connection?

3) there broadcast receiver mechanism in iphone similar android concepts well?

i had googled many links internet connectivity, , got know reachibilty class in iphone, not able clear picture on how works? if once can give me link explains me in detail reachibility, great. or other mechanism achieve above functionality.

i writing application, need start uploading data, when application know there connection available, , should happen when application in background or in foreground.

thanks in advance

you can use rechability class provided in link

also go thrugh link sure.

how check active internet connection on ios or osx?

or simple line of code usefull

reachability *reachability = [reachability reachabilityforinternetconnection];    networkstatus networkstatus = [reachability currentreachabilitystatus];     if (networkstatus == notreachable) {             nslog(@"there no internet connection");         } else {               nslog(@"there internet connection");               }         } 

Comments