Tag: reachability

How to detect change in network with Reachability?

I’m currently checking network connection on viewDidLoad using this: -(BOOL)reachable { ReachabilityDRC *r = [ReachabilityDRC reachabilityWithHostName:@”google.com”]; NetworkStatus internetStatus = [r currentReachabilityStatus]; if(internetStatus == NotReachable) { return NO; } return YES; } But I also want to be notified if there is a change of network, such as wifi dropped, or wifi is back, so I […]

iPhone reachability checking

I’ve found several examples of code to do what I want (check for reachability), but none of it seems to be exact enough to be of use to me. I can’t figure out why this doesn’t want to play nice. I have the reachability.h/m in my project, I’m doing #import <SystemConfiguration/SystemConfiguration.h> And I have the […]

Reachability with IP address won't work.

After inputting the Rechability classes Apple provided. Also after inputting this, Reachability reachabilityWithAddress:(const struct sockaddr_in *)hostAddress. How should we input the IP address we want to check into this line? This is the part where i’m really lost at.

Apple Reachability Notifications for Network OR Wi-Fi

This is the code I use with Reachability in my app: – (void) handleNetworkChange:(NSNotification *)notice { NetworkStatus remoteHostStatus = [reachability currentReachabilityStatus]; if(remoteHostStatus == NotReachable) { UIAlertView *alertnew = [[UIAlertView alloc] initWithTitle:@”No Internet Connection!” message:@”Your device lost internet connection!” delegate:self cancelButtonTitle:@”Close” otherButtonTitles:@”Dismiss”, nil]; [alertnew show]; } else if (remoteHostStatus == ReachableViaWWAN) { //if connected to the […]

SystemConfiguration/SystemConfiguration.h file not found

I am getting the following error in the file Reachability.h. I have the required framework. What else do I need to do? This is an app made in Xcode3 and I am trying to import in Xcode4.

iOS Reachability Not Recognizing When Host is Removed

I am building an application and trying to check and see if a device is still available on the network (by connecting to the devices IPAddress). I am using reachability to confirm that it is available. When I network access for the iOS device (turn on airplane mode for example) everything works properly, but if […]

tony million Reachability says unreachable when connected

I have searched but have not found an issue like mine. I’m sure it’s something I have over looked . I am using tony million’s reachability block method. it is working good when i have internet then no internet. the alert comes up and works just fine. but, when i have no internet and then […]

How to check network status in iphone app?

I have setup some methods to check network status in my app. In my viewDidLoad method I call initNetworkCheck: [self initNetworkCheck]; [super viewDidLoad]; if(internetActive == NO){ compose.enabled = NO; } So I want to check on startup if the hardware has internet connection. The problem is it gives me always NO but internetActive is actually […]

How do I repeat a Reachability test until it works

I have an initial tableviewcontroller which is executing a reachability check. This is working without a problem within the viewDidLoad, however I would like to know the correct way to Retry the connection until it passes. The pertinent code in my implementation file is below, I have tried inserting [self ViewDidLoad] if the connection is […]

Swift 2.0 NSURLConnection sendSynchronousRequest

I am using the code below to check for an internet connection. It was working correctly but after the Swift 2.0 update I now see an error on the line var data = NSURLConnection.sendSynchronousRequest(request, returningResponse: &response, error: nil) as NSData? saying extra argument ‘error’ in call. class func isConnectedToNetwork()->Bool{ var Status:Bool = false let url […]