|
|
#1 |
|
Use cell connection if Wifi not available in iOS.
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 robbieduncan; Jan 29, 2013 at 04:17 AM. Reason: Fix code tag |
|
|
|
0
|
|
|
#2 |
|
Your code only checks for wwan which is wifi you need to check for a host traceability instead on the other interface.
|
|
|
|
0
|
|
|
#3 |
|
@KoolStar. How do i do that? Can you give me an example.
|
|
|
|
0
|
|
|
#4 |
|
__________________
2.4 MacBook Aluminum 480GB SSD/750GB Optibay 8GB RAM CE | MacBook 2.4 SR 4GB, 320GB HD | PB G4 1.67 | 15 TiBook-DVI 800 iPhone 4S 16GB | iPhone 5 32GB
|
|
|
|
0
|
|
|
#5 |
|
Why are you specifically checking reachability for wifi. Why not use reachabilityForInternetConnection or reachabilityWithHostName if you need to check a particular host address
edit: for example, instead of Code:
wifiReach = [ITMReachability reachabilityForLocalWiFi]; Code:
wifiReach = [ITMReachability reachabilityForInternetConnection];
__________________
2012 Mac Mini, 2.6 GHz, 16GB RAM, 1TB HDD ![]() 2.4Ghz 15" Macbook Pro ![]() 32 GB iPhone 4S : 16 GB iPod nano : 16 GB iPad 3 Nikon D60 : 18-55 mm VR : 55-200 mm VR |
|
|
|
1
|
|
|
#6 |
|
@waterskier2007. Thanks. That solved my problem.
|
|
|
|
0
|
![]() |
|
| Tags |
| cellular, error, ios, reachability, wifi |
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 03:11 PM.







2012 Mac Mini, 2.6 GHz, 16GB RAM, 1TB HDD 
Linear Mode
