Bug 5838 - IsGeolocationAvailable and IsGeolocationEnabled show true when app has been denied location privilages
Summary: IsGeolocationAvailable and IsGeolocationEnabled show true when app has been d...
Status: RESOLVED FIXED
Alias: None
Product: Mobile API (Preview)
Classification: Xamarin
Component: Xamarin.iOS ()
Version: Preview
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Eric Maupin
URL:
Depends on:
Blocks:
 
Reported: 2012-06-24 14:42 UTC by Dylan
Modified: 2012-07-16 22:00 UTC (History)
2 users (show)

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

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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Dylan 2012-06-24 14:42:28 UTC
IsGeolocationAvailable and IsGeolocationEnabled both return true, even though the app has been denied location permissions on MonoTouch. 

To reproduce:
- Press Allow when the app asks if you can use location services
- Go into settings and disable that app's specific location privilege

Both properties now return true which is incorrect.
Comment 1 Dylan 2012-06-27 08:11:52 UTC
I can confirm that this is also a bug on Mono for Android.

The cell and gps has been switched off yet IsGeolocationAvailable and IsGeolocationEnabled both erroneously return true.
Comment 2 Eric Maupin 2012-06-27 10:49:20 UTC
(In reply to comment #1)
> I can confirm that this is also a bug on Mono for Android.
> 
> The cell and gps has been switched off yet IsGeolocationAvailable and
> IsGeolocationEnabled both erroneously return true.

Can you check that wireless network support is also disabled? This is likely what's reporting it as enabled.
Comment 3 Dylan 2012-06-27 11:02:34 UTC
On MonoTouch (with wifi on or off):
 - Location Services are switched on
 - The specific app's location services are toggled off in the Location Services settings page

When the MonoTouch app runs IsGeolocationAvailable and IsGeolocationEnabled both return true which I don't think is right.
Comment 4 Dylan 2012-06-27 11:07:44 UTC
On MonoTouch (with wifi on or off):
 - Location Services are switched on
 - The specific app's location services are toggled off in the Location Services settings page

When the MonoTouch app runs IsGeolocationAvailable and IsGeolocationEnabled both return true which I don't think is right.
Comment 5 Dylan 2012-06-27 11:08:04 UTC
Sorry duplicate.
Comment 6 Eric Maupin 2012-06-27 11:10:13 UTC
(In reply to comment #4)
> On MonoTouch (with wifi on or off):
>  - Location Services are switched on
>  - The specific app's location services are toggled off in the Location
> Services settings page
> 
> When the MonoTouch app runs IsGeolocationAvailable and IsGeolocationEnabled
> both return true which I don't think is right.

Yes, that's confirmed, I was responding to your comment regarding MfA.
Comment 7 Jean-Louis 2012-06-27 11:17:55 UTC
With regards to MfA,

I can confirm that with both the

 - wireless networks and
 - GPS satelites

are disabled on the android phone. The IsGeolocationAvailable and IsGeolocationEnabled are still both true with these settings disabled.
Comment 8 Eric Maupin 2012-06-27 14:39:25 UTC
FYI, IsGeolocationAvailable is generally always going to be true, it just states that there is a method for obtaining location on the device. IsGeolocationEnabled is where the bug is.

The reason this is showing true is that the "passive" location provider is always available. This doesn't really fit into the use case scenario here and is more of a specialized Android feature, I will exclude the passive provider which will result in the expected behavior.
Comment 9 Eric Maupin 2012-07-16 22:00:08 UTC
This is fixed, and the update is available: http://xamarin.com/mobileapi