Exemplo n.º 1
0
    IEnumerator CustomSignup()
    {
        WWW http = new WWW("http://130.211.189.213:8000/customtoken");

        // WWW http = new WWW("http://192.168.20.83:3000/customtoken");
        yield return(http);

        if (!string.IsNullOrEmpty(http.error))
        {
            ErrorText.text = http.error;
        }
        else
        {
            ErrorText.text = http.text;
            auth.SignInWithCustomTokenAsync(http.text).ContinueWith(task => {
                if (task.IsCanceled)
                {
                    return;
                }
                if (task.IsFaulted)
                {
                    return;
                }

                FirebaseUser user = task.Result;
                UserId.text       = user.UserId;

                ErrorText.text = "signin custom token successfully!";
            });
        }
    }
Exemplo n.º 2
0
        // [END on_stop_remove_listener]

        async Task StartSignIn()
        {
            try {
                await auth.SignInWithCustomTokenAsync(customToken);
            } catch {
                Toast.MakeText(this, "Authentication failed.", ToastLength.Short).Show();
            }
        }
        public async Task <IFirebaseUser> SignInWithCustomTokenAsync(string token)
        {
            var authResult = await _firebaseAuth.SignInWithCustomTokenAsync(token);

            return(authResult.User.ToAbstract(authResult.AdditionalUserInfo));
        }