Skip to content

Commit 09ee268

Browse files
authored
Also check the legacy build indicator when deciding if this is a new app install or an update. (#152)
1 parent be3d5b6 commit 09ee268

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

android/src/main/java/com/segment/analytics/kotlin/android/plugins/AndroidLifecyclePlugin.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,10 @@ class AndroidLifecyclePlugin() : Application.ActivityLifecycleCallbacks, Default
228228
// Get the previous recorded version.
229229
val previousVersion = storage.read(Storage.Constants.AppVersion)
230230
val previousBuild = storage.read(Storage.Constants.AppBuild)
231+
val legacyPreviousBuild = storage.read(Storage.Constants.LegacyAppBuild)
231232

232233
// Check and track Application Installed or Application Updated.
233-
if (previousBuild == null) {
234+
if (previousBuild == null && legacyPreviousBuild == null) {
234235
analytics.track(
235236
"Application Installed",
236237
buildJsonObject {

core/src/main/java/com/segment/analytics/kotlin/core/Storage.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ interface Storage {
3737
Events("segment.events"),
3838
AppVersion("segment.app.version"),
3939
AppBuild("segment.app.build"),
40+
LegacyAppBuild("build"),
4041
DeviceId("segment.device.id")
4142
}
4243

0 commit comments

Comments
 (0)