/// <summary>
        /// Attaches the given phone credentials to the user. This allows the user to sign in to this account in the future with credentials for such provider.
        /// </summary>
        /// <param name="verificationId">The verification ID obtained by calling VerifyPhoneNumber.</param>
        /// <param name="verificationCode">The 6 digit SMS-code sent to the user.</param>
        /// <returns>Updated current account</returns>
        public IObservable <IFirebaseAuthResult> LinkWithPhoneNumber(string verificationId, string verificationCode)
        {
            AuthCredential credential = PhoneAuthProvider.GetCredential(verificationId, verificationCode);

            return(_user.LinkWithCredentialAsync(credential).ToObservable().Select(x => new FirebaseAuthResult(x)));
            //return LinkWithCredentialAsync(credential).ToObservable();
        }
示例#2
0
        private async Task <IFirebaseAuthResult> LinkWithCredentialAsync(AuthCredential credential)
        {
            try
            {
                IAuthResult authResult = await _user.LinkWithCredentialAsync(credential);

                return(new FirebaseAuthResult(authResult));
            }
            catch (FirebaseException ex)
            {
                throw GetFirebaseAuthException(ex);
            }
        }