From 38b2b9e4e7efbc822352b166508351c22c3d5b5c Mon Sep 17 00:00:00 2001 From: Jared McFarland Date: Thu, 5 May 2022 17:22:00 -0700 Subject: [PATCH 1/2] get lib name and version --- Sources/MixpanelInstance.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Sources/MixpanelInstance.swift b/Sources/MixpanelInstance.swift index 51b211bc..ae5d7692 100644 --- a/Sources/MixpanelInstance.swift +++ b/Sources/MixpanelInstance.swift @@ -160,7 +160,14 @@ open class MixpanelInstance: CustomDebugStringConvertible, FlushDelegate, AEDele Logger.disableLevel(.error) } #if DEBUG - Network.sendHttpEvent(eventName: "Toggle SDK Logging", apiToken: "metrics-1", distinctId: apiToken, properties: ["Logging Enabled": loggingEnabled]) + var trackProps: Properties = ["Logging Enabled": loggingEnabled] + if (self.superProperties["mp_lib"] != nil) { + trackProps["mp_lib"] = self.superProperties["mp_lib"] as! String + } + if (self.superProperties["$lib_version"] != nil) { + trackProps["$lib_version"] = self.superProperties["$lib_version"] as! String + } + Network.sendHttpEvent(eventName: "Toggle SDK Logging", apiToken: "metrics-1", distinctId: apiToken, properties: trackProps) #endif } } From c9f4507aa8df360b77a4e68f6804b53ee1b74c13 Mon Sep 17 00:00:00 2001 From: Jared McFarland Date: Thu, 5 May 2022 17:31:25 -0700 Subject: [PATCH 2/2] remove self --- Sources/MixpanelInstance.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/MixpanelInstance.swift b/Sources/MixpanelInstance.swift index ae5d7692..660f37fe 100644 --- a/Sources/MixpanelInstance.swift +++ b/Sources/MixpanelInstance.swift @@ -161,10 +161,10 @@ open class MixpanelInstance: CustomDebugStringConvertible, FlushDelegate, AEDele } #if DEBUG var trackProps: Properties = ["Logging Enabled": loggingEnabled] - if (self.superProperties["mp_lib"] != nil) { + if (superProperties["mp_lib"] != nil) { trackProps["mp_lib"] = self.superProperties["mp_lib"] as! String } - if (self.superProperties["$lib_version"] != nil) { + if (superProperties["$lib_version"] != nil) { trackProps["$lib_version"] = self.superProperties["$lib_version"] as! String } Network.sendHttpEvent(eventName: "Toggle SDK Logging", apiToken: "metrics-1", distinctId: apiToken, properties: trackProps)