コード例 #1
0
        private void auth_Completed(object sender, global::Xamarin.Auth.AuthenticatorCompletedEventArgs e)
        {
            if (e.IsAuthenticated)
            {
                // e.Account contains info:
                //		e.AccountProperties[""]
                //
                // use access tokenmore detailed user info from the API

                this.AccountProperties = e.Account.Properties;
            }
            else
            {
                // The user cancelled
            }

            // dismiss UI on iOS, because it was manually created
            // IOS
            //          DismissViewController(true, null);
            // Android

            // possibly do something to dismiss THIS viewcontroller,
            // or else login screen does not disappear

            return;
        }
コード例 #2
0
        private void auth_Completed(object sender, global::Xamarin.Auth.AuthenticatorCompletedEventArgs e)
        {
            if (e.IsAuthenticated)
            {
                // e.Account contains info:
                //		e.AccountProperties[""]
                //
                // use access tokenmore detailed user info from the API

                this.AccountProperties = e.Account.Properties;
            }
            else
            {
                // The user cancelled
            }

            // dismiss UI on iOS, because it was manually created
            //DismissViewController(true, null);

            // possibly do something to dismiss THIS viewcontroller,
            // or else login screen does not disappear

            var rv = System.Windows.Application.Current.RootVisual;

            Microsoft.Phone.Controls.PhoneApplicationFrame paf = null;

            paf = rv as Microsoft.Phone.Controls.PhoneApplicationFrame;
            //paf.GoBack();


            return;
        }
コード例 #3
0
        void OnAuthCompleted(object sender, global::Xamarin.Auth.AuthenticatorCompletedEventArgs e)
        {
            if (Completed != null)
            {
                Completed(sender, e);
            }

            ((Authenticator)sender).Completed -= OnAuthCompleted;
        }
コード例 #4
0
        private void auth_Completed(object sender, global::Xamarin.Auth.AuthenticatorCompletedEventArgs e)
        {
            if (eventArgs.IsAuthenticated)
            {
                //App.Current.MainPage = new ProfilePage();

                //App.Current.Properties ["access_token"] = eventArgs.Account.Properties ["access_token"].ToString();

                //AccountStore.Create (this).Save (eventArgs.Account, "Google");
            }
            else
            {
                // Auth failed - The only way to get to this branch on Google is to hit the 'Cancel' button.
                //App.Current.MainPage = new StartPage();
                //App.Current.Properties ["access_token"] = "";
            }

            return;
        }