You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
FirebaseAnaltyics behaves badly if don't wait for initializeFirebase to return, and call trackEvent.
To Reproduce
exportasyncfunctioninitFirebase(){returnFirebaseAnalytics.initializeFirebase(firebaseConfig).then(()=>{FirebaseAnalytics.setCollectionEnabled({enabled: true,});})}exportconstfirebaseReady=initFirebase()
## ifyoucallFirebaseAnalytics.trackEvent()here,withoutwaitingforfirebaseReady,you'll get a warning that firebase was initialized twice, and the setCollectionEnabled call will fail.
Expected behavior
There are already some readyhandlers coded in FirebaseAnalyticsWeb. i expect them to take care of this situation automatically.
Eg:
If you call trackEvent before initializeFirebase, i expect them to error.
if you call trackEvent after initializeFirebase, but before it's complete... it should wait on the promise internally and exectute.
At a minimum, it should give a more appropriate error message.
version info
@capacitor-community/firebase-analytics: 4.0.0,
@capacitor/core: 4.5.0,
The text was updated successfully, but these errors were encountered:
Describe the bug
FirebaseAnaltyics behaves badly if don't wait for initializeFirebase to return, and call trackEvent.
To Reproduce
Expected behavior
There are already some readyhandlers coded in FirebaseAnalyticsWeb. i expect them to take care of this situation automatically.
Eg:
If you call trackEvent before initializeFirebase, i expect them to error.
if you call trackEvent after initializeFirebase, but before it's complete... it should wait on the promise internally and exectute.
At a minimum, it should give a more appropriate error message.
version info
@capacitor-community/firebase-analytics: 4.0.0,
@capacitor/core: 4.5.0,
The text was updated successfully, but these errors were encountered: