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 23, 2024
1 parent eb7e292 commit d206a3b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
7 changes: 0 additions & 7 deletions Sources/ODP/OdpManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,6 @@ public class OdpManager {
completionHandler: completionHandler)
}

func sendInitializedEvent() {
guard let vuid = self.vuid else {
return
}
eventManager?.sendInitializedEvent(vuid: vuid)
}

func identifyUser(userId: String) {
guard enabled else {
logger.d("ODP identify event is not dispatched (ODP disabled).")
Expand Down
13 changes: 9 additions & 4 deletions Sources/Optimizely/OptimizelyClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ open class OptimizelyClient: NSObject {

self.odpManager = odpManager ?? OdpManager(sdkKey: sdkKey,
disable: sdkSettings.disableOdp,
vuid: self.vuid,
cacheSize: sdkSettings.segmentsCacheSize,
cacheTimeoutInSecs: sdkSettings.segmentsCacheTimeoutInSecs,
timeoutForSegmentFetchInSecs: sdkSettings.timeoutForSegmentFetchInSecs,
Expand All @@ -121,9 +120,15 @@ open class OptimizelyClient: NSObject {
self.datafileHandler = HandlerRegistryService.shared.injectDatafileHandler(sdkKey: self.sdkKey)
self.decisionService = HandlerRegistryService.shared.injectDecisionService(sdkKey: self.sdkKey)
self.notificationCenter = HandlerRegistryService.shared.injectNotificationCenter(sdkKey: self.sdkKey)
if vuid != nil {
self.odpManager.vuid = vuid
self.odpManager.sendInitializedEvent()
if let _vuid = vuid {
self.odpManager.vuid = _vuid
try? sendOdpEvent(type: Constants.ODP.eventType,
action: "client_initialized",
identifiers: [
Constants.ODP.keyForVuid: _vuid
],
data: [:])

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

0 comments on commit d206a3b

Please sign in to comment.