Giter VIP home page Giter VIP logo

Comments (5)

tonymillion avatar tonymillion commented on May 22, 2024

If you have a look at the connection flags (using the reachabilityFlags method) and check kSCNetworkReachabilityFlagsInterventionRequired is set, that will let you know the app needs to present a login browser.

from reachability.

hashier avatar hashier commented on May 22, 2024

That's not working either:

Code:
Reachability* reach = [Reachability reachabilityWithHostname:@"www.google.com"];
NSLog(@"%@", [reach currentReachabilityFlags]);
NSLog(@"%@", [reach currentReachabilityString]);
if ([reach isInterventionRequired]) {
NSLog(@"DNS works, but no internet");
} else {
NSLog(@"Connected to the internet");
}
reach.reachableBlock = ^(Reachability*reach)
{
NSLog(@"REACHABLE!");
};

Output:
2013-05-28 20:11:25.009 test[57961:c07] -R -------
2013-05-28 20:11:25.011 test[57961:c07] WiFi
2013-05-28 20:11:25.012 test[57961:c07] Connected to the internet
2013-05-28 20:11:25.051 test[57961:1903] REACHABLE!

From my mac:
$ ping google.com
PING google.com (173.194.69.139): 56 data bytes
Request timeout for icmp_seq 0

And if I open a browser I get to a webpage where I have to authenticate

from reachability.

xanderdunn avatar xanderdunn commented on May 22, 2024

I'm also having difficulty with this scenario. It would be really nice to have a simple solution to this situation because working DNS without a working Internet is the same to app users: I need to tell them they have a network problem. A good example is free airport Wifi. Although I have isReachable == True, I also have isInterventionRequired == NO, even though I get a login screen in any browser and I'm unable to access any websites.

from reachability.

tonymillion avatar tonymillion commented on May 22, 2024

I can't really do anything about captive portals like this.

The best bet would be to do this at the application level i.e.

  1. Create a server endpoint that returns a specific response e.g. OK_APPNAME
  2. When reachability reports its reachable attempt to contact a server you control over HTTP and check the response.
  3. if response != OK_APPNAME then its a safe bet to say you have some kind of MITM

from reachability.

hashier avatar hashier commented on May 22, 2024

It would be cool if reachability would help out with this for example set an endpoint www.example.com/json and when this json returns something predefined reachability says "internet available".

Or trying to fetch the header from google.com and see if it says google in it or something else, e.g. airport/hotel name of providing internet service.

from reachability.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.