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)

See Also:
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

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?

Note You need to log in before you can comment on or make changes to this bug.