예제 #1
0
        public void AuthStateChanged(object sender, FirebaseAuth.AuthStateEventArgs e)
        {
            var user = e?.Auth?.CurrentUser;

            if (user != null)
            {
                isAuth = true;
                FirebaseLogService.UserLoginSignup("Email");
                SetUserData(user);
            }
            else
            {
                isAuth = false;
            }
        }
예제 #2
0
        public async Task <Boolean> CreateAccountAsync(string email, string password)
        {
            try
            {
                await FirebaseAuth.Instance.CreateUserWithEmailAndPasswordAsync(email, password);

                FirebaseLogService.UserLoginSignup("Email", true);
                return(true);
            }
            catch (Exception ex)
            {
                // Sign-up failed, display a message to the user
                // If sign in succeeds, the AuthState event handler will
                var exx = ex;
                //Toast.MakeText(this, "Sign In failed", ToastLength.Short).Show();
                return(false);
            }
        }
예제 #3
0
        public async Task <Boolean> SignIAsync(string email, string password)
        {
            try
            {
                await FirebaseAuth.Instance.SignInWithEmailAndPasswordAsync(email, password);

                FirebaseLogService.UserLoginSignup("Email");
                return(true);
            }
            catch (Exception ex)
            {
                // Sign-in failed, display a message to the user
                // If sign in succeeds, the AuthState event handler will
                //  be notified and logic to handle the signed in user can happen there
                //TODO: use firebase log for this
                var exx = ex;
                //Toast.MakeText(this, "Sign In failed", ToastLength.Short).Show();
                return(false);
            }
        }