Skip to content

Instantly share code, notes, and snippets.

@e23z
Created September 28, 2017 20:24
Show Gist options
  • Select an option

  • Save e23z/d8045879412774de6af014f1bb21ae44 to your computer and use it in GitHub Desktop.

Select an option

Save e23z/d8045879412774de6af014f1bb21ae44 to your computer and use it in GitHub Desktop.
[App Custom Scheme] How to create a custom scheme for mobile apps. #xamarin #mobile #android #app
using Android.App;
using Android.Content;
using Android.OS;
namespace CleanMyTwitter.Android {
[Activity(Label = "SchemeActivity", NoHistory = true)]
[IntentFilter(new[] { Intent.ActionView }, Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable }, DataSchemes = new[] { "http", "https" }, DataHost = "myurl.com", AutoVerify = true)]
public class SchemeActivity : Activity {
protected override void OnCreate(Bundle savedInstanceState) {
base.OnCreate(savedInstanceState);
}
protected override void OnResume() {
base.OnResume();
Finish();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment