Bug 17408 - Reachability method IsReachable() returns true when cellular data and Airplane mode are both on (WiFi off)
Summary: Reachability method IsReachable() returns true when cellular data and Airplan...
Status: CONFIRMED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll (show other bugs)
Version: 7.0.2.x
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-01-23 21:34 UTC by Jon Goldberger [MSFT]
Modified: 2014-06-03 15:34 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Test Project (10.77 KB, application/zip)
2014-01-23 21:34 UTC, Jon Goldberger [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 17408 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Comment 1 Jon Goldberger [MSFT] 2014-01-23 21:35:23 UTC
From case 58501:
I’ve discovered an issue with Reachability, not sure if it’s a bug or not. If the iPad has a cellular modem, Airplane mode is ON and Cell Data shows ‘Airplane Mode', Reachability (See attached) returns true, as if it can reach the Internet. But when I try to load a site I get back a DNS error, can’t resolve the site. If I turn off cellular data and have Airplane mode on I get false from Reachability (as one would expect). Does this sound like a bug or is the Reachability class missing something?

Here is a sample of how I call Reachability:

if(Reachability.IsHostReachable("www.cognitopia.com"))
{
//Load server side help content
var url = new NSUrl("http://www.cognitopia.com/pphelp.php?screen=" + appDelegate.store.currentScreen);
Log.WriteLog("Help " + url.AbsoluteString);
var urlRequest = new NSUrlRequest(url);
webView.LoadRequest(urlRequest);
}
Comment 2 Jon Goldberger [MSFT] 2014-01-23 21:37:07 UTC
Note that in the sample project I provided, since I didn't know what was returned by appDelegate.store.currentScreen, I just used the base URL, i.e. nothing after the ?, but that shouldn't matter for DNS lookups I wouldn't think.
Comment 3 Jon Goldberger [MSFT] 2014-01-23 21:38:06 UTC
Additional note: Issue did not occur for me with an iPhone with a cellular data plan.
Comment 4 Sadik Ali 2014-02-25 08:58:14 UTC
I have checked this issue with attached sample on iPad. I made setting as mentioned in comment 2, I debug application and noticed that "Reachability.IsHostReachable("www.cognitopia.com")" return false and 

Checked With:
Xamarin Studio 4.2.2 (build 2)
X.iOS : 7.0.6.168
Comment 6 Sadik Ali 2014-02-26 03:32:10 UTC
Below if my observation for this issue:

1. For setting iPad with Airplane mode ON and Cellular data ON:  function "Reachability.IsHostReachable("www.cognitopia.com")" return  value true

2. For setting iPad with Airplane mode ON and Cellular data OFF: function "Reachability.IsHostReachable("www.cognitopia.com")" return  value false
Comment 7 William Grand 2014-06-03 15:34:55 UTC
I see the same conditions as Sadik Ali on iPhone 5S using iOS 7.1
This didn't used to be a problem.  Perhaps a bug was introduced with 7.1?