2929
3030import Foundation
3131import Segment
32- import Adjust
32+ import AdjustSdk
3333
3434@objc ( SEGAdjustDestination)
3535open class ObjCSegmentAdjust : NSObject , ObjCPlugin , ObjCPluginShim {
@@ -61,37 +61,29 @@ open class AdjustDestination: NSObject, DestinationPlugin {
6161 }
6262
6363 let adjustConfig = ADJConfig ( appToken: settings. appToken, environment: environment)
64-
65- if let bufferingEnabled = settings. setEventBufferingEnabled {
66- adjustConfig? . eventBufferingEnabled = bufferingEnabled
67- }
68-
64+
6965 if let _ = settings. trackAttributionData {
7066 adjustConfig? . delegate = self
7167 }
7268
73- if let useDelay = settings. setDelay, useDelay == true , let delayTime = settings. delayTime {
74- adjustConfig? . delayStart = delayTime
75- }
76-
77- Adjust . appDidLaunch ( adjustConfig)
69+ Adjust . initSdk ( adjustConfig)
7870 }
7971
8072 public func identify( event: IdentifyEvent ) -> IdentifyEvent ? {
8173 if let userId = event. userId, userId. count > 0 {
82- Adjust . addSessionPartnerParameter ( " user_id " , value : userId)
74+ Adjust . addGlobalPartnerParameter ( " user_id " , forKey : userId)
8375 }
8476
8577 if let anonId = event. anonymousId, anonId. count > 0 {
86- Adjust . addSessionPartnerParameter ( " anonymous_id " , value : anonId)
78+ Adjust . addGlobalPartnerParameter ( " anonymous_id " , forKey : anonId)
8779 }
8880
8981 return event
9082 }
9183
9284 public func track( event: TrackEvent ) -> TrackEvent ? {
9385 if let anonId = event. anonymousId, anonId. count > 0 {
94- Adjust . addSessionPartnerParameter ( " anonymous_id " , value : anonId)
86+ Adjust . addGlobalPartnerParameter ( " anonymous_id " , forKey : anonId)
9587 }
9688
9789 if let token = mappedCustomEventToken ( eventName: event. event) {
@@ -123,12 +115,12 @@ open class AdjustDestination: NSObject, DestinationPlugin {
123115 }
124116
125117 public func reset( ) {
126- Adjust . resetSessionPartnerParameters ( )
118+ Adjust . removeGlobalPartnerParameters ( )
127119 }
128120}
129121extension AdjustDestination : RemoteNotifications {
130122 public func registeredForRemoteNotifications( deviceToken: Data ) {
131- Adjust . setDeviceToken ( deviceToken)
123+ Adjust . setPushToken ( deviceToken)
132124 }
133125}
134126// Example of versioning for your plugin
@@ -141,8 +133,10 @@ extension AdjustDestination: VersionedPlugin {
141133private struct AdjustSettings : Codable {
142134 let appToken : String
143135 let setEnvironmentProduction : Bool ?
136+ @available ( * , deprecated)
144137 let setEventBufferingEnabled : Bool ?
145138 let trackAttributionData : Bool ?
139+ @available ( * , deprecated)
146140 let setDelay : Bool ?
147141 let customEvents : JSON ?
148142 let delayTime : Double ?
0 commit comments