Access Settings / Preferences for App using Device.OpenUri

Hi,

To open general settings: Device.OpenUri(new Uri(string.Format("prefs:root=Settings")));
To open Twitter settings: Device.OpenUri(new Uri(string.Format("prefs:root=TWITTER")));
To open Facebook settings: Device.OpenUri(new Uri(string.Format("prefs:root=FACEBOOK")));

all very handy, but..

How to open up the custom settings for MyApp (the app that is being used to launch the OpenUri)?

Device.OpenUri(new Uri(string.Format("prefs:root=xxxxxxx")));

It's a PCL project, want the users to get to their preference screen for this app.

Thank you for your insight.

Best Answers

Answers

  • DaveHuntDaveHunt USMember ✭✭✭✭✭

    I don't know about Android, but in iOS, you use UIApplication.OpenSettingsUrlString.

    You'll probably have to do this using a dependency service as the URL will likely be different for each platform.

  • sturentzlersturentzler USMember

    Hi Dave,

    Thank you for the quick response, and it is a good one. I looked into OpenSettingsUrlString, it would work. So your take on the answer is total right.

    but..

    I'm code-curious about if there is a way to get the App string from a pure (or pure-ish) direct Forms approach using Device.OpenUri since it is "almost" right it seems. (Almost right in coding could also: mean close, but never could happen).

    It has also made me curious about TWITTER pref being directly accessible, which is great for other app features I'm using.

    Just seeing if there is a simplified/unified approach and also if anyone knows of any deeper documentation on "pref" part as well. Want to better understand the strings that can be formed instead of using with faith and blindly. Tel and mailto are straight forward, the pref is being a bit mysterious to me at the moment.

    Any additional thoughts and insight greatly welcomed.

Sign In or Register to comment.