Screen tracking support - Firebase 9.8

Merlí Escarpenter Pérez picture Merlí Escarpenter Pérez · Nov 7, 2016 · Viewed 11.1k times · Source

According Firebase Android SDK Release Notes with 9.8 update we have screen tracking support with android screens and activities... The documentation says that this event works like that:

mFirebaseAnalytics.setCurrentScreen(activity,class_name,class_override_name);

In my case, I don't need overrides class name and I send null value... But i'm waiting 48h and my firebase analytics console doesn't show info about this event, any ideas?

Thanks in advance!

Answer

Another very important thing that I've noticed only after two days of intensive struggling: the setCurrentScreen method MUST be called on the UI thread.

I was only able to see that after looking for a light in the Firebase decompiled code:

@MainThread
@Keep
public final void setCurrentScreen(@NonNull Activity var1, @Size(min = 1L,max = 36L) @Nullable String var2, @Size(min = 1L,max = 36L) @Nullable String var3) {
    //...
}

Whenever this method is called a event of type screen_view is logged.

And keep in mind the Firebase size restrictions. The maximum size of a screen name is 36 characters long.