Open
Description
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?