The Adjust Adobe AIR SDK has been updated to v5. Follow this guide to migrate from v4 to the latest version.
The minimum supported iOS and Android versions have been updated. If your app targets a lower version, update it first.
- iOS: 12.0
- Android: API 21
In Adobe AIR SDK v5, the initialization method has changed from Adjust.start
to Adjust.initSdk
.
Adjust.initSdk(adjustConfig);
In Adobe AIR SDK v5, the environment class has been renamed from Environment
to AdjustEnvironment
.
var environment:String = AdjustEnvironment.SANDBOX;
var environment:String = AdjustEnvironment.PRODUCTION;
In Adobe AIR SDK v5, the log level class has been renamed from LogLevel
to AdjustLogLevel
.
adjustConfig.setLogLevel(AdjustLogLevel.VERBOSE);
In Adobe AIR SDK v4, you needed to declare several permissions to allow your Adobe AIR app for Android to access device information via the Adjust SDK for Android.
<android>
<manifestAdditions>
<![CDATA[
<manifest android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE" />
</manifest>
]]>
</manifestAdditions>
</android>
In Adobe AIR SDK v5, you can delete some or all from your XML configuration file, depending on your setup.
android.permission.INTERNET
is bundled in the Adjust SDK for Android.android.permission.ACCESS_WIFI_STATE
is no longer required.android.permission.ACCESS_NETWORK_STATE
is optional. This allows the SDK to access information about the network a device is connected to, and send this information as part of the callbacks parameters.com.google.android.gms.permission.AD_ID
is bundled in the Adjust SDK for Android. You can remove it with the following snippet:
<android>
<manifestAdditions>
<![CDATA[
<manifest android:installLocation="auto">
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>
</manifest>
]]>
</manifestAdditions>
</android>
Learn more about Adjust's COPPA compliance.
Below is the complete list of changed, renamed, and removed APIs in Adobe AIR SDK v5.
Each section includes a reference to the previous and current API implementations, as well as a minimal code snippet that illustrates how to use the latest version.
The following APIs have changed in Adobe AIR SDK v5.
The setEnabled
method has been renamed. Adobe AIR SDK v5 introduces two separate methods, for clarity:
- Call
Adjust.disable
to disable the SDK. - Call
Adjust.enable
to enable the SDK.
Adjust.disable(); // disable SDK
Adjust.enable(); // enable SDK
The setOfflineMode
method has been renamed. Adobe AIR SDK v5 introduces two separate methods, for clarity:
- Call
Adjust.switchToOfflineMode
to set the SDK to offline mode. - Call
Adjust.switchBackToOnlineMode
to set the SDK back to online mode.
The setSendInBackground
method has been renamed to enableSendingInBackground
.
To enable the Adobe AIR SDK v5 to send information to Adjust while your app is running in the background, call the enableSendingInBackground
method on your AjustConfig
instance. This feature is disabled by default.
adjustConfig.enableSendingInBackground();
In Adobe AIR SDK v5, the setAttributionCallbackDelegate
method has been renamed to setAttributionCallback
.
The properties of the attribution
parameter have also changed:
- The
var adid:String
is no longer part of the attribution. - The
getAdGroup()
getter method has been renamed togetAdgroup()
.
The following properties have been added to the attribution
parameter:
var costType:String
var costAmount:Number
var costCurrency:String
var fbInstallReferrer:String
Below is a sample snippet that implements these changes:
adjustConfig.setAttributionCallback(function (attribution:AdjustAttribution):void {
trace("Tracker token = " + attribution.getTrackerToken());
trace("Tracker name = " + attribution.getTrackerName());
trace("Campaign = " + attribution.getCampaign());
trace("Network = " + attribution.getNetwork());
trace("Creative = " + attribution.getCreative());
trace("Adgroup = " + attribution.getAdgroup());
trace("Click label = " + attribution.getClickLabel());
trace("Cost type = " + attribution.getCostType());
trace("Cost amount = " + isNaN(attribution.getCostAmount()) ? "NaN" : attribution.getCostAmount().toString());
trace("Cost currency = " + attribution.getCostCurrency());
trace("FB install referrer = " + attribution.getFbInstallReferrer());
});
In Adobe AIR SDK v5, event deduplication is decoupled from the event transactionId
. To prevent measuring duplicated events, use the deduplicationId
ID field.
adjustEvent.setDeduplicationId("deduplicationId");
In Adobe AIR SDK v5, the setDeviceToken
method has been renamed to setPushToken
.
Adjust.setPushToken("push-token");
In Adobe AIR SDK v5, the session callback parameters have been renamed to global callback parameters together with corresponding methods.
Adjust.addGlobalCallbackParameter("user_id", "855");
Adjust.removeGlobalCallbackParameter("user_id");
Adjust.removeGlobalCallbackParameters();
In Adobe AIR SDK v5, the session partner parameters have been renamed to global partner parameters together with corresponding methods.
Adjust.addGlobalPartnerParameter("user_id", "855");
Adjust.removeGlobalPartnerParameter("user_id");
Adjust.removeGlobalPartnerParameters();
In Adobe AIR SDK v5, the setSessionTrackingSucceededDelegate
method has been renamed to setSessionSuccessCallback
.
The getTimeStamp()
method has been renamed to getTimestamp()
.
adjustConfig.setSessionSuccessCallback(function (sessionSuccess:AdjustSessionSuccess):void {
// All session success properties.
trace("Session tracking succeeded");
trace("Message = " + sessionSuccess.getMessage());
trace("Timestamp = " + sessionSuccess.getTimestamp());
trace("Adid = " + sessionSuccess.getAdid());
trace("Json Response = " + sessionSuccess.getJsonResponse());
});
In Adobe AIR SDK v5, the setSessionTrackingFailedDelegate
method has been renamed to setSessionFailureCallback
.
The getTimeStamp()
method has been renamed to getTimestamp()
.
adjustConfig.setSessionFailureCallback(function (sessionFailure:AdjustSessionFailure):void {
// All session failure properties.
trace("Session tracking failed");
trace("Message = " + sessionFailure.getMessage());
trace("Timestamp = " + sessionFailure.getTimestamp());
trace("Adid = " + sessionFailure.getAdid());
trace("Will Retry = " + sessionFailure.getWillRetry().toString());
trace("Json Response = " + sessionFailure.getJsonResponse());
});
In Adobe AIR SDK v5, the setEventTrackingSucceededDelegate
method has been renamed to setEventSuccessCallback
.
The getTimeStamp()
method has been renamed to getTimestamp()
.
adjustConfig.setEventSuccessCallback(function (eventSuccess:AdjustEventSuccess):void {
// All event success properties.
trace("Event tracking succeeded");
trace("Message = " + eventSuccess.getMessage());
trace("Timestamp = " + eventSuccess.getTimestamp());
trace("Adid = " + eventSuccess.getAdid());
trace("Event Token = " + eventSuccess.getEventToken());
trace("Callback Id = " + eventSuccess.getCallbackId());
trace("Json Response = " + eventSuccess.getJsonResponse());
});
In Adobe AIR SDK v5, the setEventTrackingFailedDelegate
method has been renamed to setEventFailureCallback
.
The getTimeStamp()
method has been renamed to getTimestamp()
.
adjustConfig.setEventFailureCallback(function (eventFailure:AdjustEventFailure):void {
// All event failure properties.
trace("Event tracking failed");
trace("Message = " + eventFailure.getMessage());
trace("Timestamp = " + eventFailure.getTimestamp());
trace("Adid = " + eventFailure.getAdid());
trace("Event Token = " + eventFailure.getEventToken());
trace("Callback Id = " + eventFailure.getCallbackId());
trace("Will Retry = " + eventFailure.getWillRetry().toString());
trace("Json Response = " + eventFailure.getJsonResponse());
});
In Adobe AIR SDK v5, the appWillOpenUrl
method has been renamed to processDeeplink
.
To process a direct deep link, create a new AdjustDeeplink
instance with the deep link URL, and pass it to the Adjust.processDeeplink
method.
var app:NativeApplication = NativeApplication.nativeApplication;
app.addEventListener(InvokeEvent.INVOKE, onInvoke);
// ...
private static function onInvoke(event:InvokeEvent):void {
if (event.arguments.length == 0) {
return;
}
var deeplink:String = event.arguments[0];
trace("Deeplink = " + deeplink);
var adjustDeeplink:AdjustDeeplink = new AdjustDeeplink(deeplink);
Adjust.processDeeplink(adjustDeeplink);
}
In Adobe AIR SDK v5, the setShouldLaunchDeeplink
method has been renamed to disableDeferredDeeplinkOpening
. Opening deferred deep links is enabled by default.
To disable opening deferred deep links, call the renamed method:
adjustConfig.disableDeferredDeeplinkOpening();
In Adobe AIR SDK v5, the setDeferredDeeplinkDelegate
method has been renamed to setDeferredDeeplinkCallback
.
To set a deferred deep link callback, call the setDeferredDeeplinkCallback
method on your AdjustConfig
instance:
adjustConfig.setDeferredDeeplinkCallback(function (deeplink:String):void {
trace("Received deferred deep link");
trace("Deep link = " + deeplink);
});
In Adobe AIR SDK v5, the deactivateSKAdNetworkHandling
method has been renamed to disableSkanAttribution
. The SKAdNetwork
API is enabled by default.
To disable the SKAdNetwork
communication, call the disableSkanAttribution
method on your AdjustConfig
instance.
adjustConfig.disableSkanAttribution();
In Adobe AIR SDK v5, the requestTrackingAuthorizationWithCompletionHandler
method has been renamed to requestAppTrackingAuthorization
for clarity.
The renamed method is invoked like so:
Adjust.requestAppTrackingAuthorization(function (status:String):void {
trace("Status = " + status);
});
In Adobe AIR SDK v4, all device information getter methods run synchronously.
In SDK v5, the following methods have been changed to run asynchronously.
Adjust.getAdid(function (adid:String):void {
trace("Adjust ID = " + adid);
});
Adjust.getAmazonAdId(function (amazonAdId:String):void {
trace("Amazon Advertising ID = " + amazonAdId);
});
Adjust.getIdfa(function (idfa:String):void {
trace("IDFA = " + idfa);
});
Adjust.getAttribution(function (attribution:AdjustAttribution):void {
trace("Tracker token = " + attribution.getTrackerToken());
trace("Tracker name = " + attribution.getTrackerName());
trace("Campaign = " + attribution.getCampaign());
trace("Network = " + attribution.getNetwork());
trace("Creative = " + attribution.getCreative());
trace("Adgroup = " + attribution.getAdgroup());
trace("Click label = " + attribution.getClickLabel());
trace("Cost type = " + attribution.getCostType());
trace("Cost amount = " + isNaN(attribution.getCostAmount()) ? "NaN" : attribution.getCostAmount().toString());
trace("Cost currency = " + attribution.getCostCurrency());
trace("FB install referrer = " + attribution.getFbInstallReferrer());
});
The following APIs have been removed from Adobe AIR SDK v5.
- The
setDelayStart
method has been removed. - The
sendFirstPackages
method has been removed. - The
setEventBufferingEnabled
method has been removed. - The
setReadMobileEquipmentIdentity
method has been removed. (non-Google Play Store Android apps only)
The disableThirdPartySharing
method has been removed.
To disable all third-party sharing in Adobe AIR SDK v5, use the trackThirdPartySharing method.
var adjustThirdPartySharing:AdjustThirdPartySharing = new AdjustThirdPartySharing("false");
Adjust.trackThirdPartySharing(adjustThirdPartySharing);
The setAppSecret
method has been removed.
The SDK signature library is bundled in Adjust SDKs v5 and enabled by default. To configure the anti-spoofing solution in the Adjust Dashboard, follow the integration guide for your platform.
This feature has been removed. If your Adobe AIR app uses the Huawei referrer API, contact your Adjust representative or email [email protected] before you upgrade.