Before you begin
Here’s what you need to do before updating to SDK v5:
- SDK v5 supports SDK signature verification natively. If you currently use the SDK signature library, you need to uninstall this first.
- If your app targets API versions lower than the following, you need to update your app before you can use SDK v5:
- iOS: 12.0
- tvOS: 12.0
Install the SDK
To start using SDK v5, you need to add it as a dependency in your XCode project. To do this:
-
Remove any older versions of the SDK you currently have in your
Podfile
. -
Add the following line to your
Podfile
: -
Run
pod install
to install the dependencies.
Update the initialization method
In SDK v4, the initialization method is Adjust.onCreate(AdjustConfig)
. This has been changed to Adjust.initSdk(AdjustConfig)
in SDK v5.
New APIs
The following APIs have been added in SDK v5.
Disable IDFA reading
In SDK v5, you can prevent the Adjust SDK from reading the device ID for Advertisers (IDFA) by calling the disableIdfaReading
method on your AdjustConfig
instance.
Disable deferred deep link opening
In SDK v5, you can prevent the SDK from opening deferred deep links by calling the disableDeferredDeeplinkOpening
method of your AdjustConfig
instance.
Disable SKAdNetwork attribution
In SDK v5, you can prevent the Adjust SDK from sending attribution information to Apple’s SKAdNetwork by calling the disableSkanAttributionHandling
method of your AdjustConfig
instance.
SKAdNetwork update callback
In SDK v5, you can configure the Adjust SDK to execute a callback function when a user’s SKAdNetwork conversion value changes by calling the setSkanUpdatedCallback
method of your AdjustConfig
instance with a callback function.
Changed APIs
The following APIs have been changed in SDK v5.
Disable AdServices information reading
In SDK v4, you can call the setAllowAdServicesInfoReading
method of your AdjustConfig
instance with a false
argument to prevent the Adjust SDK from reading AdServices information.
In SDK v5, you need to call the disableAdServices
method with no arguments to prevent the Adjust SDK from reading AdServices information.
Disable and enable the SDK
In SDK v4, you can enable and disable the SDK by calling Adjust.setEnabled()
with a boolean
value.
- Call
Adjust.setEnabled(false)
to disable the SDK. - Call
Adjust.setEnabled(true)
to enable the SDK
In SDK v5, this feature is split into separate commands for clarity.
- Call
Adjust.disable()
to disable the SDK. - Call
Adjust.enable()
to enable the SDK.
Offline mode
In SDK v4, you can enable and disable offline mode in the SDK by calling Adjust.setOfflineMode()
with a boolean
value.
In SDK v5, this feature is split into separate commands for clarity.
- Call
Adjust.switchToOfflineMode()
to set the SDK to offline mode. - Call
Adjust.switchBackToOnlineMode()
to set the SDK back to online mode.
Enable cost data in attribution
In SDK v4, you can enable the SDK to send cost data as part of a user’s attribution by calling the setNeedsCost
method of your AdjustConfig
instance with a boolean argument.
In SDK v5, this method has been renamed to enableCostDataInAttribution
for clarity. This new method takes no arguments.
Session callback parameters
Session callback parameters has been renamed to Global callback parameters in SDK v5.
Session partner parameters
Session partner parameters has been renamed to Global partner parameters in SDK v5.
Event deduplication
In SDK v4, event deduplication is coupled with the event order ID
and is limited to a maximum of 10 unique IDs.
In SDK v5, the feature is decoupled from order ID
. A new ID field called deduplicationId
has been added for event deduplication. Users can set a custom limit on the number of deduplicationId
that can be added to the list for identifying duplicate events. By default, the limit is set to 10.
COPPA compliance
In SDK v4, COPPA compliance is set by calling the setCoppaCompliantEnabled
method on your AdjustConfig
instance with a boolean argument.
In SDK v5, this method is renamed to enableCoppaCompliance
for clarity. This new method accepts no arguments.
Set data residency and URL strategy
In SDK v4, URL strategy and data residency domains are defined as constants in the AdjustConfig
class.
In SDK v5, you need to pass your chosen domain or domains as an array. You can also set the following:
useSubdomains
(boolean
): Whether the source should prefix a subdomain.isDataResidency
(boolean
): Whether the domain should be used for data residency.
Check the table below to see how to configure your URL strategy in SDK v5.
v4 | v5 - main and fallback domain | v5 - use sub domains | v5 - is Data Residency |
---|---|---|---|
AdjustConfig.DataResidencyEU | "eu.adjust.com" | true | true |
AdjustConfig.DataResidencyTR | "tr.adjust.com" | true | true |
AdjustConfig.DataResidencyUS | "us.adjust.com" | true | true |
AdjustConfig.UrlStrategyChina | "adjust.world" , "adjust.com" | true | false |
AdjustConfig.UrlStrategyCn | "adjust.cn" , "adjust.com" | true | false |
AdjustConfig.UrlStrategyCnOnly | "adjust.cn" | true | false |
AdjustConfig.UrlStrategyIndia | "adjust.net.in" , "adjust.com" | true | false |
Examples
Request ATT authorization status
In SDK v4, you can handle changes to a user’s ATT authorization status using the Adjust.requestTrackingAuthorizationWithCompletionHandler
method.
This has been renamed to requestAppTrackingAuthorizationWithCompletionHandler
in SDK v5 for clarity.
Device ID getters
In SDK v4, all device ID getter methods run synchronously. In SDK v5, these methods have been changed to run asynchronously.
Removed APIs
The following APIs have been removed in SDK v5.
Event buffering
SDK v4 supports event buffering. This feature stores requests event, ad revenue, push tokens, and other information on a local buffer to send at a later date.
This setting has been removed in SDK v5.
Custom user agent string
SDK v4 supports setting a custom User Agent by calling the setUserAgent
method of your AdjustConfig
instance with a user agent string.
This setting has been removed in SDK v5.
Set whether a device is known
In SDK v4, you can call the setDeviceKnown
method of your AdjustConfig
instance to manually inform the SDK whether a device is known.
This setting has been removed in SDK v5.
Delay SDK start
SDK v4 supports delaying the start of the SDK by calling the setDelayStart
method on your AdjustConfig
instance with up to 120 seconds of delay. If the app is ready before the delay ends, information can be sent immediately by calling Adjust.sendFirstPackages
.
Both of these methods have been removed in SDK v5.
Set push token
SDK v4 supports setting a device push token by calling Adjust.setDeviceToken
with your push token.
This feature has been removed in SDK v5.
Reattribution using deep links
In SDK v4, you can pass a deep link URL to Adjust in the Web bridge by calling the Adjust.appWillOpenUrl()
method.
This method has been removed in SDK v5.
Adjust LinkMe
In SDK v4, you can enable Adjust LinkMe using the Adjust Web bridge by calling the setLinkMeEnabled
method of your AdjustConfig
instance with a boolean argument.
This method has been removed in SDK v5.
Send ad revenue from a specific source
In SDK v4, you can send ad revenue from a specific source by passing a source and payload to the Adjust.trackAdRevenue()
method.
This method has been removed in SDK v5.
Disable third party sharing globally
In SDK v4, you can call the Adjust.disableThirdPartySharing()
method to globally disable sharing information with third parties globally.
This feature has been removed from SDK v5. In SDK v5, use the Adjust.trackThirdPartySharing()
method to enable or disable third party sharing.
Check for ATT status
In SDK v4, you can check for changes to a user’s ATT status by calling the Adjust.checkForNewAttStatus
method.
This method has been removed in SDK v5.
Set an App Secret
SDK v4 supports setting an App Secret by calling the setAppSecret
method of your AdjustConfig
instance to sign the SDK traffic with.
This setting has been removed in SDK v5.