SimpleAuth.OAuthApi.OAuthApi C# (CSharp) Method

OAuthApi() static private method

static private OAuthApi ( ) : System
return System
		static OAuthApi ()
		{
			//Setup default ShowAuthenticator
			#if __IOS__
			OAuthApi.ShowAuthenticator = (authenticator) => {
				var invoker = new Foundation.NSObject ();
				invoker.BeginInvokeOnMainThread (() => {
					var vc = new iOS.WebAuthenticatorViewController (authenticator);
					var window = UIKit.UIApplication.SharedApplication.KeyWindow;
					var root = window.RootViewController;
					if (root != null) {
						var current = root;
						while (current.PresentedViewController != null) {
							current = current.PresentedViewController;
						}
						current.PresentViewControllerAsync (new UIKit.UINavigationController (vc), true);
					}
				});
			};

			#elif __ANDROID__
			OAuthApi.ShowAuthenticator = (authenticator) =>
			{
				var context = Android.App.Application.Context;
				var i = new global::Android.Content.Intent(context, typeof(WebAuthenticatorActivity));
				var state = new WebAuthenticatorActivity.State
				{
					Authenticator = authenticator,
				};
				i.SetFlags(Android.Content.ActivityFlags.NewTask);
				i.PutExtra("StateKey", WebAuthenticatorActivity.StateRepo.Add(state));
				context.StartActivity(i);
			};
			#elif __OSX__
			OAuthApi.ShowAuthenticator = (authenticator) =>
			{
				var invoker = new Foundation.NSObject();
				invoker.BeginInvokeOnMainThread(() =>
				{
					var vc = new SimpleAuth.Mac.WebAuthenticatorWebView(authenticator);
					SimpleAuth.Mac.WebAuthenticatorWebView.ShowWebivew(vc);
				});
			};

            #elif WINDOWS_UWP
			OAuthApi.ShowAuthenticator = async (authenticator) =>
			{
				await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
				{
					var vc = new SimpleAuth.UWP.WebAuthenticatorWebView(authenticator);
					await vc.ShowAsync();
				});
			};

			#endif
		}

Same methods

OAuthApi::OAuthApi ( string identifier, OAuthAuthenticator authenticator, HttpMessageHandler handler = null ) : System
OAuthApi::OAuthApi ( string identifier, string clientId, string clientSecret, HttpMessageHandler handler = null ) : System
OAuthApi::OAuthApi ( string identifier, string clientId, string clientSecret, string tokenUrl, string authorizationUrl, string redirectUrl = "http://localhost", HttpMessageHandler handler = null ) : System