-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Don't call Firebase functions before CheckDependencies has finished #1075
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Hi @WiseKodama, thanks for reaching out. The Firebase SDK checks to make sure that all the necessary dependencies are included before it runs. Do you have the condition checker of
You can take a look into our Firebase Unity Quickstart for reference. It'll help guide you in configuring your project correctly. Let me know if that helps. Thanks! |
I do but more complex projects do not work that way. |
I understand and sorry for the issue you're experiencing right now. Unfortunately, the current design does not allow any calls prior to the There were also previous discussions of this in the quickstart. I did see an alternative posted by one of the developers, however I haven't tried it myself. For now, I'll mark this as a feature request, and bring this up to our engineers to see if we have updates or future plans. However, please note that we currently don't have a timeline for this. I'll reply back here once we receive feedback. Thanks! |
I fixed this as follows;
C'est Ça, no more errors. |
I also have a work around.
However I cannot believe Google would have such a lazy implementation,
seeing as they have the highest talent supposedly.
The queueing of all actions should be on their end.
Not to mention if you access Firebase before it’s done everything will miss
fire.
Guess they don’t test or do code reviews.
Sadly there is no other good/free alternative so we are stuck patching the
holes.
…On Sat, 21 Sep 2024 at 11:20, Jeroen de Bonte ***@***.***> wrote:
I fixed this as follows;
For every time I need to send something to Firebase (e.g. an Event), I
wrote a function and passed the eventcall in this function, like so:
- First, write the function that accepts a string as the input:
public static void CheckIfReady(string message)
{
Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
Firebase.DependencyStatus dependencyStatus = task.Result;
if (dependencyStatus == Firebase.DependencyStatus.Available)
{
Firebase.FirebaseApp app = Firebase.FirebaseApp.DefaultInstance;
Debug.Log("Firebase is ready for use.");
FirebaseAnalytics.LogEvent(message);
}
else
{
UnityEngine.Debug.LogError(System.String.Format(
"Could not resolve all Firebase dependencies: {0}", dependencyStatus));
}
});
}
Then, you can call this function with the input event, like so:
CheckIfReady("Your LogEvent goes here...");
C'est ca, no more errors.
—
Reply to this email directly, view it on GitHub
<#1075 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGC7FIMF2HV45QGXJMOTIQTZXU25LAVCNFSM6AAAAABLH2YGKOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRVGA4DSNJQGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Description
Why is this a thing? Why is accessing Static fields(FirebaseAnalytics.EventScreenView and FirebaseAnalytics.ParametersScreenName) an issue?
We had an issue where RemoteConfig did not work if Firebase functions were called before CheckDependencies finished, however I have no info if this is happening to these users...
Please remove this exception and ensure that it works normally even if a FirebaseFunction is called.
Reproducing the issue
This is happening to our live users and reported through Crashlytics, so repocase is not known.
I would assume a slow device should produce this...
Firebase Unity SDK Version
11.7.0
Unity editor version
2022.3.38f1
Installation Method
.unitypackage
Problematic Firebase Component(s)
Analytics
Other Firebase Component(s) in use
Crashlytics, Remote Config
Additional SDKs you are using
AppLovin MAX, Qonversion
Targeted Platform(s)
Android
Unity editor platform
Windows
Scripting Runtime
IL2CPP
Release Distribution Type
Pre-built SDK from https://firebase.google.com/download/unity
Relevant Log Output
If using CocoaPods for Apple platforms, the project's Podfile.lock
Expand
Podfile.lock
snippet👀 Replace this line with the contents of your Podfile.lock!
The text was updated successfully, but these errors were encountered: