From 91604eb97f68d88089c04343a54b34af8fd37441 Mon Sep 17 00:00:00 2001 From: Fabrizio Demaria Date: Tue, 28 May 2024 10:27:34 +0200 Subject: [PATCH] refactor: No message in `app-launched` (#128) refactor: app-launched no msg --- .../Confidence/ConfidenceAppLifecycleProducer.swift | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Sources/Confidence/ConfidenceAppLifecycleProducer.swift b/Sources/Confidence/ConfidenceAppLifecycleProducer.swift index 205208e1..944d975a 100644 --- a/Sources/Confidence/ConfidenceAppLifecycleProducer.swift +++ b/Sources/Confidence/ConfidenceAppLifecycleProducer.swift @@ -67,19 +67,14 @@ public class ConfidenceAppLifecycleProducer: ConfidenceEventProducer, Confidence let currentVersion: String = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "" let currentBuild: String = Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "" - let message: ConfidenceStruct = [ - Self.versionNameContextKey: .init(string: currentVersion), - Self.buildNumberContextKey: .init(string: currentBuild) - ] - if eventName == Self.appLaunchedEventName { if previousBuild == nil && previousVersion == nil { - events.send(Event(name: ConfidenceAppLifecycleProducer.appInstalledEventName, message: message)) + events.send(Event(name: ConfidenceAppLifecycleProducer.appInstalledEventName, message: [:])) } else if previousBuild != currentBuild || previousVersion != currentVersion { - events.send(Event(name: ConfidenceAppLifecycleProducer.appUpdatedEventName, message: message)) + events.send(Event(name: ConfidenceAppLifecycleProducer.appUpdatedEventName, message: [:])) } } - events.send(Event(name: eventName, message: message)) + events.send(Event(name: eventName, message: [:])) UserDefaults.standard.setValue(currentVersion, forKey: Self.userDefaultVersionNameKey) UserDefaults.standard.setValue(currentBuild, forKey: Self.userDefaultBuildNameKey)