I am new to Xamarin iOS and mobile dev in general. I have a application which requires location services, on my view controller I have a button which takes the user to location settings for the app, however, if the main device location is off the user will not be able to do anything with the app level location setting.
I am using this code on my button click event to take the user to the settings page.
if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
{
NSString settingsString = UIApplication.OpenSettingsUrlString;
NSUrl url = new NSUrl(settingsString);
UIApplication.SharedApplication.OpenUrl(url);
}
I would like to know if there is a way to check if device level Location services are off and take the user to that settings page instead of app-level location settings and vice versa.
Also how to take users to Location settings screen if device level location services is disabled. I tried a few combinations but I am unsure what the NSUrl will be.