Android Firebase session calculation for app which is in background

319 views Asked by At

I'm trying to figure out how can I apply this guide to my code and this SO answer, precisely:

A session begins to time out when an app is moved to the background, but you have the option to extend that session by logging the extend_session parameter (with a value of 1) on events logged while the app is in the background.

This is my code (which I want to use on events, when my service is running and activities are on pause / stop):

Bundle params = new Bundle();
params.putInt("extend_session", 1);
firebaseAnalytics.logEvent("app_in_background", params);

The event is custom, because default one doesn't suite my need.

Long story short, I want to see how much time (average) the service is running and possibly having this data listed in Where are your users engaged? table (Firebase console).

What I want to achieve is: how much my users are engaged while using my app service ? Am I using the correct approach ?

0

There are 0 answers