Esempio n. 1
0
        void initSignInButtons()
        {
            var stackView = new UIStackView
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                Axis         = UILayoutConstraintAxis.Vertical,
                Spacing      = 10,
                Alignment    = UIStackViewAlignment.Fill,
                Distribution = UIStackViewDistribution.FillEqually
            };

            View.AddSubview(stackView);

#if NC_AUTH_GOOGLE
            stackView.AddArrangedSubview(AuthButtonGoogle);

            SignIn.SharedInstance.UIDelegate = this;
            SignIn.SharedInstance.Delegate   = this;

            // Uncomment to automatically sign in the user.
            SignIn.SharedInstance.SignInUserSilently();

            // Uncomment to automatically sign out the user.
            // SignIn.SharedInstance.SignOutUser ();
#endif
#if NC_AUTH_FACEBOOK
            stackView.AddArrangedSubview(AuthButtonFacebook);

            if (AccessToken.CurrentAccessToken != null)
            {
                // User is logged in, do work such as go to next view controller.
                Log.Debug($"Facebook Current Access Token: {AccessToken.CurrentAccessToken}");
            }
            else
            {
                Log.Debug($"Facebook Current Access Token: null");
            }
#endif
#if NC_AUTH_MICROSOFT
            stackView.AddArrangedSubview(AuthButtonMicrosoft);
#endif
#if NC_AUTH_TWITTER
            stackView.AddArrangedSubview(AuthButtonTwitter);
#endif

            stackView.ConstrainToParentCenter(240, stackView.ArrangedSubviews.Length * 52);
        }