Skip to content

[FR] Able to drop analytics events before CheckAndFixDependenciesAsync() completes #853

Open
@AntonPetrov83

Description

@AntonPetrov83

The official guide recommends to set a flag when CheckAndFixDependenciesAsync completes to indicate that Firebase is ready.

Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
  var dependencyStatus = task.Result;
  if (dependencyStatus == Firebase.DependencyStatus.Available) {
    // Create and hold a reference to your FirebaseApp,
    // where app is a Firebase.FirebaseApp property of your application class.
       app = Firebase.FirebaseApp.DefaultInstance;

    // Set a flag here to indicate whether Firebase is ready to use by your app.
  } else {
    UnityEngine.Debug.LogError(System.String.Format(
      "Could not resolve all Firebase dependencies: {0}", dependencyStatus));
    // Firebase Unity SDK is not safe to use here.
  }
});

Otherwise, an exception gets thrown:

InvalidOperationException: Don't call Firebase functions before CheckDependencies has finished

So how am I supposed to log early events? What are the best practices?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions