Add logout to posthog on Android

This commit is contained in:
Jackson Harper
2023-09-14 16:27:50 +08:00
parent e51543b6bf
commit a601ab2bda
3 changed files with 7 additions and 2 deletions

View File

@ -17,8 +17,8 @@ android {
applicationId "app.omnivore.omnivore"
minSdk 26
targetSdk 33
versionCode 97
versionName "0.0.97"
versionCode 99
versionName "0.0.99"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {

View File

@ -31,4 +31,8 @@ class EventTracker @Inject constructor(val app: Context) {
fun track(eventName: String, properties: Properties = Properties()) {
posthog.capture(eventName, properties)
}
fun logout() {
posthog.reset()
}
}

View File

@ -272,6 +272,7 @@ class LoginViewModel @Inject constructor(
datastoreRepo.clear()
dataService.clearDatabase()
Intercom.client().logout()
eventTracker.logout()
}
}