Skip to content

Commit

Permalink
Fix Application Installed (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
remstos authored Sep 17, 2024
1 parent 338be8f commit be28488
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Sources/Segment/Plugins/Platforms/iOS/iOSLifecycleEvents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ class iOSLifecycleEvents: PlatformPlugin, iOSLifecycle {
let currentVersion: String = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? ""
let currentBuild: String = Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? ""

if let previousBuild,
if previousBuild == nil {
analytics?.track(name: "Application Installed", properties: [
"version": currentVersion,
"build": currentBuild
])
} else if let previousBuild,
currentBuild != previousBuild {
analytics?.track(name: "Application Updated", properties: [
"previous_version": previousVersion ?? "",
"previous_build": previousBuild,
"version": currentVersion,
"build": currentBuild
])
} else {
analytics?.track(name: "Application Installed", properties: [
"version": currentVersion,
"build": currentBuild
])
])
}

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

0 comments on commit be28488

Please sign in to comment.