Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Created attachment 867 [details]
Steps to reproduce.
1. on iPhone, go to Settings > General > Reset > Reset Location Warnings
2. on iPhone go to Settings > Location Services > Turn it off completely for
the phone just to be sure
3. build and deploy app
4. when prompted to turn on location services hit "Cancel"
5. verify that nothing gets printed to console
I can reproduce. I will check how an objectiveC application behave in such condition.
Even stranger is that after you hit cancel, minimize the app, bring the app back to foreground. Sometimes the message pops up again. Do that one or two more times and the app stops responding.
I used Apple's Locations sample  and got the same result, i.e. "locationManager:didFailWithError:" (Failed in MonoTouch) is _not_ called if the location service is turned off. Documentation  is not very clear but it does not cover this case (service off) only the case where the user denies the application.
However you can workaround this by doing this:
public override void ViewDidAppear (bool animated)
Failed (this, new NSErrorEventArgs (new NSError ()));
which directly called Failed (to share logic) and also disable/remove the iOS alert that ask you if you wish to start the location service (if its something you're looking for).
> Sometimes the message pops up again.
I suspect that's because the application sometimes resume (not showing the alert) and other times it is restarted (showing the alert again).
Thanks for looking into it. Yes, the documentation could be a little more explicit.