Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
muzahidul-opti committed Nov 21, 2024
1 parent 8c61683 commit 330814a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
8 changes: 3 additions & 5 deletions Sources/ODP/OdpManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,11 @@ public class OdpManager {
cacheTimeoutInSecs: cacheTimeoutInSecs,
resourceTimeoutInSecs: timeoutForSegmentFetchInSecs)
self.eventManager = eventManager ?? OdpEventManager(sdkKey: sdkKey,
resourceTimeoutInSecs: timeoutForEventDispatchInSecs)
resourceTimeoutInSecs: timeoutForEventDispatchInSecs)

self.odpConfig = OdpConfig()
self.segmentManager.odpConfig = odpConfig
self.eventManager.odpConfig = odpConfig
if let vuid = vuid, VuidManager.isVuid(vuid) {
self.eventManager.sendInitializedEvent(vuid: vuid)
}
}

func fetchQualifiedSegments(userId: String,
Expand Down Expand Up @@ -122,7 +120,7 @@ public class OdpManager {

var identifiersUpdated = identifiers

if identifiers[Constants.ODP.keyForVuid] == nil, let _vuid = vuid {
if identifiers[Constants.ODP.keyForVuid] == nil, let _vuid = vuid, VuidManager.isVuid(_vuid) {
identifiersUpdated[Constants.ODP.keyForVuid] = _vuid
}

Expand Down
20 changes: 10 additions & 10 deletions Sources/Optimizely/OptimizelyClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ open class OptimizelyClient: NSObject {
self.vuidManager.configure(enable: self.sdkSettings.enableVuid)
self.odpManager = odpManager ?? OdpManager(sdkKey: sdkKey,
disable: sdkSettings.disableOdp,
vuid: VuidManager.shared.vuid,
cacheSize: sdkSettings.segmentsCacheSize,
cacheTimeoutInSecs: sdkSettings.segmentsCacheTimeoutInSecs,
timeoutForSegmentFetchInSecs: sdkSettings.timeoutForSegmentFetchInSecs,
timeoutForEventDispatchInSecs: sdkSettings.timeoutForOdpEventInSecs)
self.odpManager.vuid = self.vuidManager.vuid
let userProfileService = userProfileService ?? DefaultUserProfileService()
let logger = logger ?? DefaultLogger()
type(of: logger).logLevel = defaultLogLevel ?? .info
Expand All @@ -118,15 +118,15 @@ open class OptimizelyClient: NSObject {
self.decisionService = HandlerRegistryService.shared.injectDecisionService(sdkKey: self.sdkKey)
self.notificationCenter = HandlerRegistryService.shared.injectNotificationCenter(sdkKey: self.sdkKey)

// if self.enableVuid {
// try? sendOdpEvent(type: Constants.ODP.eventType,
// action: "client_initialized",
// identifiers: [
// Constants.ODP.keyForVuid: self.vuid
// ],
// data: [:])
//
// }
if self.enableVuid {
try? sendOdpEvent(type: Constants.ODP.eventType,
action: "client_initialized",
identifiers: [
Constants.ODP.keyForVuid: self.vuid
],
data: [:])

}

logger.d("SDK Version: \(version)")
}
Expand Down

0 comments on commit 330814a

Please sign in to comment.