Skip to content

Commit be28488

Browse files
authored
Fix Application Installed (#359)
1 parent 338be8f commit be28488

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Sources/Segment/Plugins/Platforms/iOS/iOSLifecycleEvents.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ class iOSLifecycleEvents: PlatformPlugin, iOSLifecycle {
4040
let currentVersion: String = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? ""
4141
let currentBuild: String = Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? ""
4242

43-
if let previousBuild,
43+
if previousBuild == nil {
44+
analytics?.track(name: "Application Installed", properties: [
45+
"version": currentVersion,
46+
"build": currentBuild
47+
])
48+
} else if let previousBuild,
4449
currentBuild != previousBuild {
4550
analytics?.track(name: "Application Updated", properties: [
4651
"previous_version": previousVersion ?? "",
4752
"previous_build": previousBuild,
4853
"version": currentVersion,
4954
"build": currentBuild
50-
])
51-
} else {
52-
analytics?.track(name: "Application Installed", properties: [
53-
"version": currentVersion,
54-
"build": currentBuild
55-
])
55+
])
5656
}
5757

5858
let sourceApp: String = launchOptions?[UIApplication.LaunchOptionsKey.sourceApplication] as? String ?? ""

0 commit comments

Comments
 (0)