Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8896535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:06:06+00:00 2026-06-15T00:06:06+00:00

I am using Apple’s reachability code, and am setting up both initial notifications on

  • 0

I am using Apple’s reachability code, and am setting up both initial notifications on when network reachability changes and prior to initiating a server connection. The code works when I am on wi-fi and I turn the wi-fi access point off. However, when I start the app with wi-fi and the underlying broadband connection working, and then once the app is running, and then disconnect the wi-fi router from the broadband router (i.e. Wi-Fi is on but there is no internet connectivity), and I do a reachability check, the network status I get is ReachableViaWiFi. I have tried both reachabilityForInternetConnection and reachabilityWithHostName.

Any ideas on if Apple’s reachability code can be used to detect a situation where the wifi is connected but there is no underlying network connectivity?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T00:06:07+00:00Added an answer on June 15, 2026 at 12:06 am

    ok, I found out the answer to this – Apple’s reachability does not test actual connectivity to the host. See the answer by @Zhami in the SO link below:

    How to write a simple Ping method in Cocoa/Objective-C

    Essentially, when you first launch the app and do a reachability check, iOS seems to do a DNS lookup, and if there is no internet, the check fails. So the first time you check reachability , it actually returns a meaningful value. However, if you are conected at app launch, and lose internet connectivity after some time (while still connected to WiFi/3G/4G but no underlying internet connectivity), further reachability checks return reachable even though the internet or your specified host is not reachable anymore.

    So if you want to really check for connectivity in real time, consider using the following:

    -(BOOL) isConnected
    {
    
        NSString* url = [NSURL URLWithString:@"http://www.google.com/m"];
        ASIHTTPRequest* request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:url]];
        [request    setTimeOutSeconds:10];
    //customize as per your needs - note this check is synchronous so you dont want to block the main thread for too long
        [request setNumberOfTimesToRetryOnTimeout:0];
        [request startSynchronous];
    
        NSError *error = [request error];
        if (error)
        {
            DLog(@"connectivity error");
            return NO;
        }
        else
        {
            DLog(@"connectivity OK");
            return YES;
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Setting up SVN using Apple Developer Connection manual ( http://developer.apple.com/mac/articles/server/subversionwithxcode3.html ). Regardless of it,
We were using Apple's Reachability a few months ago to check for the network
I'm using Apple Document to create an app.I succeed in connection to the server,
I am using apple's custom table view cell code and modifying the drawRect code
Apple advises using the following code to detect whether running on an iPad or
I'm using Apple's sample code for having separate Portrait and Landscape view controllers (presenting/dismissing
There is so much info out there on using Apple's Reachability example, and so
I'm using Apple's llvm-gcc to compile some code with inline assembly. I wrote what
I was using apple's scrollview sample code PhotoScroller for my app using numerous images
I am using Apple's sample code for the MessageUI and MFMailComposeViewControllerDelegate, and mostly it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.