Iphone internet connection (Reachability)
- by ludo
Hi,
I saw any post about Reachability but people doesn't really give the exact answer to the problem.
In my application I use the Reachability code from apple and in my appDelegate I use this:
-(BOOL)checkInternet {
Reachability *reachability = [Reachability reachabilityWithHostName:@"www.google.com"];
NetworkStatus internetStatus = [reachability currentReachabilityStatus];
BOOL internet;
if ((internetStatus != ReachableViaWiFi) && (internetStatus != ReachableViaWWAN)) {
internet = NO;
}else {
internet = YES;
}
return internet;
}
So the problem is even if I have an internet connection, this code telling me that I don't have one.
Does anyone know what to do to make this working?
Thanks,