firebase / firebase/quickstart-unity
[FR] Able to drop analytics events before CheckAndFixDependenciesAsync() completes
- Dominant language
- C#
- Stars
- 923
- Forks
- 456
- PR merge metrics
- No merged PRs in 30d
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?
Contributor guide
Research direction
Start with the official Firebase Unity guide snippet and the CheckAndFixDependenciesAsync entry point described in the issue. Determine the supported behavior for analytics events raised before dependency completion and document or implement an agreed approach; done means early events no longer trigger the reported exception and the recommended usage is clear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, firebase, unity
- Domain
- analytics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100