Code:
wifiReach = [ITMReachability reachabilityForLocalWiFi];
[wifiReach startNotifier];
NetworkStatus netStatus = [wifiReach currentReachabilityStatus];
BOOL connectionRequired= [wifiReach connectionRequired];
switch (netStatus)
{
case NotReachable:
{
statusString = @"Access Not Available";
connectionRequired= NO;
break;
}
case ReachableViaWWAN:
{
NSLog(@"WWAN is reachable");
wifiAvailable = YES;
statusString = @"Reachable WWAN";
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Yes Reachable Login"
message:@"Please enter the correct login details."
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil, nil];
[alert show]
; break;
}
case ReachableViaWiFi:
{
wifiAvailable = YES;
statusString= @"Reachable WiFi";
break;
}
}
Last edited by a moderator: