Skip to content

Commit 001dae1

Browse files
committed
Updating Adjust SDK to 5.0.1
1 parent 4946476 commit 001dae1

File tree

2 files changed

+14
-20
lines changed

2 files changed

+14
-20
lines changed

Package.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let package = Package(
77
name: "SegmentAdjust",
88
platforms: [
99
.iOS("13.0"),
10-
.tvOS("11.0"),
10+
.tvOS("12.0"),
1111
.watchOS("7.1")
1212
],
1313
products: [
@@ -25,16 +25,16 @@ let package = Package(
2525
from: "1.4.1"
2626
),
2727
.package(
28-
name: "Adjust",
28+
name: "AdjustSdk",
2929
url: "https://github.com/adjust/ios_sdk.git",
30-
from: "4.38.0")
30+
from: "5.0.1")
3131
],
3232
targets: [
3333
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
3434
// Targets can depend on other targets in this package, and on products in packages this package depends on.
3535
.target(
3636
name: "SegmentAdjust",
37-
dependencies: ["Segment", "Adjust"])
37+
dependencies: ["Segment", "AdjustSdk"])
3838

3939
// TESTS ARE HANDLED VIA THE EXAMPLE APP.
4040
]

Sources/SegmentAdjust/AdjustDestination.swift

+10-16
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
import Foundation
3131
import Segment
32-
import Adjust
32+
import AdjustSdk
3333

3434
@objc(SEGAdjustDestination)
3535
open 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
}
129121
extension 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 {
141133
private 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

Comments
 (0)