29
29
30
30
import Foundation
31
31
import Segment
32
- import Adjust
32
+ import AdjustSdk
33
33
34
34
@objc ( SEGAdjustDestination)
35
35
open class ObjCSegmentAdjust : NSObject , ObjCPlugin , ObjCPluginShim {
@@ -61,37 +61,29 @@ open class AdjustDestination: NSObject, DestinationPlugin {
61
61
}
62
62
63
63
let adjustConfig = ADJConfig ( appToken: settings. appToken, environment: environment)
64
-
65
- if let bufferingEnabled = settings. setEventBufferingEnabled {
66
- adjustConfig? . eventBufferingEnabled = bufferingEnabled
67
- }
68
-
64
+
69
65
if let _ = settings. trackAttributionData {
70
66
adjustConfig? . delegate = self
71
67
}
72
68
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)
78
70
}
79
71
80
72
public func identify( event: IdentifyEvent ) -> IdentifyEvent ? {
81
73
if let userId = event. userId, userId. count > 0 {
82
- Adjust . addSessionPartnerParameter ( " user_id " , value : userId)
74
+ Adjust . addGlobalPartnerParameter ( " user_id " , forKey : userId)
83
75
}
84
76
85
77
if let anonId = event. anonymousId, anonId. count > 0 {
86
- Adjust . addSessionPartnerParameter ( " anonymous_id " , value : anonId)
78
+ Adjust . addGlobalPartnerParameter ( " anonymous_id " , forKey : anonId)
87
79
}
88
80
89
81
return event
90
82
}
91
83
92
84
public func track( event: TrackEvent ) -> TrackEvent ? {
93
85
if let anonId = event. anonymousId, anonId. count > 0 {
94
- Adjust . addSessionPartnerParameter ( " anonymous_id " , value : anonId)
86
+ Adjust . addGlobalPartnerParameter ( " anonymous_id " , forKey : anonId)
95
87
}
96
88
97
89
if let token = mappedCustomEventToken ( eventName: event. event) {
@@ -123,12 +115,12 @@ open class AdjustDestination: NSObject, DestinationPlugin {
123
115
}
124
116
125
117
public func reset( ) {
126
- Adjust . resetSessionPartnerParameters ( )
118
+ Adjust . removeGlobalPartnerParameters ( )
127
119
}
128
120
}
129
121
extension AdjustDestination : RemoteNotifications {
130
122
public func registeredForRemoteNotifications( deviceToken: Data ) {
131
- Adjust . setDeviceToken ( deviceToken)
123
+ Adjust . setPushToken ( deviceToken)
132
124
}
133
125
}
134
126
// Example of versioning for your plugin
@@ -141,8 +133,10 @@ extension AdjustDestination: VersionedPlugin {
141
133
private struct AdjustSettings : Codable {
142
134
let appToken : String
143
135
let setEnvironmentProduction : Bool ?
136
+ @available ( * , deprecated)
144
137
let setEventBufferingEnabled : Bool ?
145
138
let trackAttributionData : Bool ?
139
+ @available ( * , deprecated)
146
140
let setDelay : Bool ?
147
141
let customEvents : JSON ?
148
142
let delayTime : Double ?
0 commit comments