objective c - IOS Checking Active internet connection even connected via WIFI without internet -



objective c - IOS Checking Active internet connection even connected via WIFI without internet -

please help me out how check net connection in iphone.

i tried checking apple's reachability framework, not returning if connected via wifi without internet.

what getting reachable via wifi.

the other alternative tried making synchronous request google.com etc , checking response code.

is there other way check can avoid making url request , checking response code.

thanks in advance.

check if wifi reachable (using apple's reachability), , create request ensure host reachable.

// wifi checking code here //... [[[nsurlsession sharedsession] datataskwithurl:[nsurl urlwithstring:@"http://yourserver.com/somelightfile.html"] completionhandler:^(nsdata *data, nsurlresponse *response, nserror *error) { if (!error) { // host reachable } }] resume];

ios objective-c iphone ios7

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -