firebase / firebase/quickstart-unity

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

Open
#853 6 comments 2 reactions 0 assignees View on GitHub
api: analytics type: feature request
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.