Skip to content

Instantly share code, notes, and snippets.

@yuv4ik
Created May 2, 2018 18:00
Show Gist options
  • Save yuv4ik/c94f971fb0f7cd2ae86ac571296fd2fb to your computer and use it in GitHub Desktop.
Save yuv4ik/c94f971fb0f7cd2ae86ac571296fd2fb to your computer and use it in GitHub Desktop.
[Xamarin.Forms] Open App Settings
public class SettingsHelper
{
public void OpenAppSettings()
{
var intent = new Intent(Android.Provider.Settings.ActionApplicationDetailsSettings);
intent.AddFlags(ActivityFlags.NewTask);
var uri = Android.Net.Uri.FromParts("package", package_name, null);
intent.SetData(uri);
Application.Context.StartActivity(intent);
}
}
public class SettingsHelper
{
public void OpenAppSettings()
{
var url = new NSUrl($"app-settings:{app_bundle_id}");
UIApplication.SharedApplication.OpenUrl(url);
}
}
public interface ISettingsHelper
{
void OpenAppSettings();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment