I'm using AFNetworking's reachability manager to monitor reachability for a specific domain, as illustrated below:
reachabilityManager = [AFNetworkReachabilityManager managerForDomain:@"www.xyz.com"];
[reachabilityManager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
switch (status) {
case AFNetworkReachabilityStatusReachableViaWWAN:
case AFNetworkReachabilityStatusReachableViaWiFi:
DLog(@"***became reachable***");
break;
case AFNetworkReachabilityStatusNotReachable:
default:
DLog(@"***became UNreachable***");
break;
}
}];
[reachabilityManager startMonitoring];
It works well except when the device is connected to a captive portal/network with all other data disabled. For some reason the manager believes that the device is in a reachable state, despite the fact that the domain is in fact unreachable (if one were to input the corresponding URL in a browser, it redirects to the captive portal's sign-in page).
Am I doing something wrong? If not, is there any way around this?
Thanks!