[gallery] add Firebase Analytics "app_open" event

PiperOrigin-RevId: 778165756
This commit is contained in:
Wai Hon Law 2025-07-01 13:21:09 -07:00 committed by Copybara-Service
parent d97e115993
commit f271d49f4b

View file

@ -62,6 +62,19 @@ class MainActivity : ComponentActivity() {
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
}
override fun onResume() {
super.onResume()
firebaseAnalytics?.logEvent(
"app_open",
Bundle().apply {
putString("app_version", BuildConfig.VERSION_NAME)
putString("os_version", Build.VERSION.SDK_INT.toString())
putString("device_model", Build.MODEL)
},
)
}
companion object {
private const val TAG = "AGMainActivity"
}