Beispiel #1
0
        public Task Authenticate()
        {
            if (Authenticator1 == null && Authenticator2 == null)
            {
                return(Task.CompletedTask);
            }

            UIRuntime.OnActivated.Handle(arg =>
            {
                //var uri = new Uri(url.AbsoluteString);
                //Authenticator1?.OnPageLoading(uri);
                //Authenticator2?.OnPageLoading(uri);
            });

            var ui = Authenticator1?.GetUI();

            if (ui == null)
            {
                ui = Authenticator2?.GetUI();
            }
            var currentFrame = Windows.UI.Xaml.Window.Current.Content as Windows.UI.Xaml.Controls.Frame;

            currentFrame.Navigate(ui);

            return(Task.CompletedTask);
        }
Beispiel #2
0
        public Task Authenticate()
        {
            if (Authenticator1 == null && Authenticator2 == null)
            {
                return(Task.CompletedTask);
            }

            UIRuntime.OnNewIntent.Handle(intent =>
            {
                var uri = new Uri(intent.Data.ToString());
                Authenticator1?.OnPageLoading(uri);
                Authenticator2?.OnPageLoading(uri);
            });

            var ui = Authenticator1?.GetUI(UIRuntime.CurrentActivity);

            if (ui == null)
            {
                ui = Authenticator2?.GetUI(UIRuntime.CurrentActivity);
            }
            UIRuntime.CurrentActivity.StartActivity(ui);

            return(Task.CompletedTask);
        }
Beispiel #3
0
        public Task Authenticate()
        {
            if (Authenticator1 == null && Authenticator2 == null)
            {
                return(Task.CompletedTask);
            }

            UIRuntime.OnOpenUrl.Handle(url =>
            {
                var uri = new System.Uri(url.AbsoluteString);
                Authenticator1?.OnPageLoading(uri);
                Authenticator2?.OnPageLoading(uri);
            });

            var ui = Authenticator1?.GetUI();

            if (ui == null)
            {
                ui = Authenticator2?.GetUI();
            }
            (UIRuntime.NativeRootScreen as UIViewController)?.PresentViewController(ui, animated: true, completionHandler: () => UICompeletion.Raise());

            return(Task.CompletedTask);
        }