Wi-Fi is connected and Internet is not available iOS

My question is the same as this question , but not getting the right answer.

If I am connected to Wi-Fi, but the Internet is unavailable / gone, it should be notified. Alslo checked using a demonstration of Apple Reachability , but still does not work.

Steps to play:

1) connect iPhone using pairing with another device.

2) run a demonstration of rights to the apple.

3) disconnect the cellular data on another device on which the iPhone is connected.

+4
source share
1 answer

, NSURLConnection. , Wi-Fi , .

NSMutableURLRequest *headerRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"] cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:10.0];
    headerRequest.HTTPMethod = @"HEAD";
    self.headerConnection = [[NSURLConnection alloc] initWithRequest:headerRequest delegate:self];
-1

Source: https://habr.com/ru/post/1663635/


All Articles