skip to Main Content

I was using Firebase cloud functions in Unity2022.3.11 and got an error "USE_AUTH_EMULATOR not set." and froze.

What is this and what is needed to prevent the error from occurring?

Unitypackage has been installed. And written codes like that.

FirebaseFunctions func;
FirebaseAuth auth;


        await FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
        {
            if(task.Result == DependencyStatus.Available)
            {
        auth = FirebaseAuth.DefaultInstance;
                func = FirebaseFunctions.DefaultInstance;
            }
            else
            {
                Debug.Log(task.Result.ToString());
                return;
            }
        });
        try
        {
            if(auth.CurrentUser.UserId == null)
            {
                await auth.SignInAnonymouslyAsync();
            }
            else
            {
                Debug.Log($"Already auth {auth.CurrentUser.UserId}");
            }
        }

var task = func.GetHttpsCallable("task").CallAsync(idToken);

2

Answers


  1. Chosen as BEST ANSWER

    I found an answer.

    await func.GetHttpsCallable("task").CallAsync(idToken).ContinueWith(task =>
            {
                return task.Result.Data.ToString();
            });
    
            return "";
    

    But another error has happened.

    FunctionsException: INTERNAL
    

    What that means?


  2. Are you sure that it is an error? The Firebase Unity SDK is built on top of the Firebase C++ SDK, which logs "USE_AUTH_EMULATOR not set" at the Info level.

    If USE_AUTH_EMULATOR is not set, the SDK logs that message and connects to the live Firebase Auth service. If it has any other value, the Firebase Auth Emulator is connected instead, based on the relevant configuration (defaults to localhost:9099 at time of writing).

    That log message is no cause for alarm.

    If your application has frozen, there is something else that is the cause.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search