Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin iOS Navigate to Settings

I have been trying to find a way to navigate to navigate from an Application to the Settings preferences for the Application.

I have tried the following, yet unfortunately it does error.

      var root = new UINavigationController ();
      root.PushViewController (new Uri ("prefs:root=General"), true);

When trying this, I did believe it would error as it should be used to Navigate to an already made view.

Is there anyway I am able to navigate to the settings application as required via the use of Xamarin C#?

Thanks.

like image 761
Christopher Orchard Avatar asked Dec 26 '22 19:12

Christopher Orchard


2 Answers

Sorry, you can't. Apple disabled the ability to do this in iOS 5.1.

The only option is creating your own preferences UI and displaying that instead.


Edit: as of iOS 8, you can take the user direct to your app's preferences:

UIApplication.SharedApplication.OpenUrl(new NSUrl(UIApplication.OpenSettingsUrlString))
like image 95
Tom Gilder Avatar answered Dec 28 '22 09:12

Tom Gilder


The following code is working in iPhone.

var url = new NSUrl("prefs:root=Settings");
UIApplication.SharedApplication.OpenUrl(url);
like image 41
JKLTechnologies Avatar answered Dec 28 '22 09:12

JKLTechnologies