Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it necessary to use await for analytics().logEvent?

Sometimes some of my events do not get logged in the Firebase DebugView and I'm currently trying to find out why.

We decided about leaving out the await for firebase.analytics().logEvent(...), and now I wonder if that could lead to the missing events. In my understanding this should not make a difference in the behavior, because I don't have to wait for the event to be logged.

So my question is: Does it make a difference in reliability of the event logging in the following two cases?

// With await
await firebase.analytics().logEvent('event_name');

// Without await
firebase.analytics().logEvent('event_name');

Thank you!

like image 965
27leaves Avatar asked Nov 06 '22 08:11

27leaves


1 Answers

firebase.analytics().* gives u a promise which you need to handle. Under the hood the methods call the firebase app which optimizes communications to Firebase GA servers. You can enable logs

adb shell setprop log.tag.FA VERBOSE
adb shell setprop log.tag.FA-SVC VERBOSE

and watch them with

adb logcat -v time -s FA FA-SVC
like image 147
Anton Avatar answered Jan 19 '23 07:01

Anton