Skip to content

Commit

Permalink
Add app start event
Browse files Browse the repository at this point in the history
  • Loading branch information
Morteza-Rastgoo committed Sep 7, 2021
1 parent a611025 commit 4598a73
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import se.kantarsifo.mobileanalytics.framework.Logger.fatalError
import se.kantarsifo.mobileanalytics.framework.Logger.log
import se.kantarsifo.mobileanalytics.framework.TagStringsAndValues.SIFO_APP_START_EVENT_CATEGORY
import se.kantarsifo.mobileanalytics.framework.Utils.isPackageInstalled
import java.net.HttpCookie

Expand Down Expand Up @@ -57,6 +58,8 @@ internal class TSMobileAnalyticsBackend : TSMobileAnalytics {

initTags(activity, cpID!!, applicationName!!, onlyPanelist)

sendAppStartEvent()

PanelistHandler.syncCookies(activity, activity) {
refreshCookiesAndKeys(activity,onlyPanelist)
frameworkInstance!!.dataRequestHandler.setStateReady()
Expand Down Expand Up @@ -126,6 +129,18 @@ internal class TSMobileAnalyticsBackend : TSMobileAnalytics {
return true
}

/**
* Sends the app start event
*/
private fun sendAppStartEvent() {
if (frameworkInstance ==null) {
log("Cannot create app start event")
return
}

frameworkInstance!!.sendTag(SIFO_APP_START_EVENT_CATEGORY)
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,9 @@ object TagStringsAndValues {
*/
internal const val SIFO_META_COOKIE_NAME = "sifo_config"

/**
* app start event category name
*/
internal const val SIFO_APP_START_EVENT_CATEGORY = "appstart"

}

0 comments on commit 4598a73

Please sign in to comment.