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
Post a Comment