Skip to content

Commit

Permalink
Dispatch install event tracking on internal queue
Browse files Browse the repository at this point in the history
  • Loading branch information
matus-tomlein committed Nov 14, 2023
1 parent d2b2408 commit 940b0d4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/Core/Tracker/Tracker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ class Tracker: NSObject {

private func checkInstall() {
if installEvent {
DispatchQueue.global(qos: .default).async { [weak self] in
InternalQueue.async { [weak self] in
guard let self = self else { return }

let installTracker = InstallTracker()
let previousTimestamp = installTracker.previousInstallTimestamp
installTracker.clearPreviousInstallTimestamp()
Expand All @@ -305,7 +307,7 @@ class Tracker: NSObject {
let installEvent = SelfDescribingJson(schema: kSPApplicationInstallSchema, andDictionary: data)
let event = SelfDescribing(eventData: installEvent)
event.trueTimestamp = previousTimestamp // it can be nil
let _ = self?.track(event)
let _ = self.track(event)
}
}
}
Expand Down

0 comments on commit 940b0d4

Please sign in to comment.