4

The creation of a user with email and password fails and I can't find the source of the problem.

I'm using "Firebase Unity SDK" with the auth and database packages.

I followed this tutorial on the Firebase web page.

This is the C# code I use in my Unity project.

using UnityEngine;
using Firebase.Auth;

public class FirebaseAuthEmail : MonoBehaviour
{
    public string email = "[email protected]";
    public string password = "abccbe123321";

    void Start()
    {
        FirebaseAuth auth = FirebaseAuth.DefaultInstance;
        auth.CreateUserWithEmailAndPasswordAsync(email, password).ContinueWith(
            task => {
                if (!task.IsCanceled && !task.IsFaulted)
                {
                    // User created
                    Debug.Log("User created");
                }
                else
                {
                    // User creation failed
                    Debug.Log("User creation failed");
                }
                if (task.IsCanceled) { Debug.Log("Task canceled"); }
                if (task.IsFaulted) { Debug.Log("Task faulted"); }
            });
    }
}

When I press the play button i get "User creation failed" and "Task faulted".

I've successfully managed to add entries to the database but not to create an authenticated user.

And yes I've enabled Email/Password in the Firebase console.

Thanks in advance

1 Answer 1

6

Firebase Auth doesn't work on Unity Editor.

https://github.com/firebase/quickstart-unity/issues/3

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.