Open nk-mohan opened 5 years ago
Any update on this. Even in our app end session events are not getting tracked. Also if you reopen the app again there is no start session event logged. Below is the code
sharedPref = getSharedPreferences(PREF_EMPLOYEE, PRIVATE_MODE)
val empId = sharedPref.getString("uuid","") //editor.putString("uuid", employeData.uuid)
val client: AmplitudeClient = Amplitude.getInstance()
.initialize(applicationContext, "APIKEY")
.enableForegroundTracking(application)
.trackSessionEvents(true)
.setLogLevel(Log.VERBOSE)
if(!empId.isNullOrBlank()) {
client.userId = empId
}
@raghunandankavi2010 How do you implement the app open and close events? For session events, if they are within a short time, we won't create new session events.
Got it. I was trying to open and close within 10 seconds. Also I see that when I open the app again the previous end session gets logged.
@raghunandankavi2010 Great to know. That's expected behavior.
I want to track App Open and App Closed events, Below code i have used. I'm getting App Open Event but i couldn't get App Close Event, is there anyone know how track app close event
class AppLifecycleTracker : Application.ActivityLifecycleCallbacks { private var numActivitiesStarted = 0
}