Skip to content

Commit 593c209

Browse files
clean up
1 parent 4fb5b44 commit 593c209

File tree

2 files changed

+10
-20
lines changed

2 files changed

+10
-20
lines changed

Sources/ODP/OdpManager.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ public class OdpManager {
8181
completionHandler: completionHandler)
8282
}
8383

84+
func sendInitializedEvent() {
85+
guard let vuid = self.vuid else {
86+
return
87+
}
88+
eventManager?.sendInitializedEvent(vuid: vuid)
89+
}
90+
8491
func identifyUser(userId: String) {
8592
guard enabled else {
8693
logger.d("ODP identify event is not dispatched (ODP disabled).")
@@ -120,7 +127,7 @@ public class OdpManager {
120127

121128
var identifiersUpdated = identifiers
122129

123-
if identifiers[Constants.ODP.keyForVuid] == nil, let _vuid = vuid, VuidManager.isVuid(_vuid) {
130+
if identifiers[Constants.ODP.keyForVuid] == nil, let _vuid = vuid {
124131
identifiersUpdated[Constants.ODP.keyForVuid] = _vuid
125132
}
126133

Sources/Optimizely/OptimizelyClient.swift

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,9 @@ open class OptimizelyClient: NSObject {
121121
self.datafileHandler = HandlerRegistryService.shared.injectDatafileHandler(sdkKey: self.sdkKey)
122122
self.decisionService = HandlerRegistryService.shared.injectDecisionService(sdkKey: self.sdkKey)
123123
self.notificationCenter = HandlerRegistryService.shared.injectNotificationCenter(sdkKey: self.sdkKey)
124-
125-
if let _vuid = vuid {
126-
try? sendOdpEvent(type: Constants.ODP.eventType,
127-
action: "client_initialized",
128-
identifiers: [
129-
Constants.ODP.keyForVuid: _vuid
130-
],
131-
data: [:])
132-
124+
if vuid != nil {
125+
self.odpManager.sendInitialEvent()
133126
}
134-
135127
logger.d("SDK Version: \(version)")
136128
}
137129

@@ -987,15 +979,6 @@ extension OptimizelyClient {
987979
data: data)
988980
}
989981

990-
// /// the device vuid (read only)
991-
// public var vuid: String? {
992-
// return self.vuidManager.vuid
993-
// }
994-
//
995-
// public var enableVuid: Bool {
996-
// return self.vuidManager.enable
997-
// }
998-
//
999982
func identifyUserToOdp(userId: String) {
1000983
odpManager.identifyUser(userId: userId)
1001984
}

0 commit comments

Comments
 (0)