adjust-icon

Adobe AIR SDK v5 migration guide

The Adjust Adobe AIR SDK has been updated to v5. Follow this guide to migrate from v4 to the latest version.

Before you begin

The minimum supported iOS and Android versions have been updated. If your app targets a lower version, update it first.

  • iOS: 12.0
  • Android: 21

Update the initialization method

Changed in v5

In Adobe AIR SDK v5, the initialization method has changed from Adjust.start to Adjust.initSdk.

Adjust.initSdk(adjustConfig);

Environment

In Adobe AIR SDK v5, the environment class has been renamed from Environment to AdjustEnvironment.

var environment:String = AdjustEnvironment.SANDBOX;
environment: String

The environment in which your device is running.

  • Pass AdjustEnvironment.SANDBOX when testing.
  • Pass AdjustEnvironment.PRODUCTION when running the app in production.

Log level

In Adobe AIR SDK v5, the log level class has been renamed from LogLevel to AdjustLogLevel.

adjustConfig.setLogLevel(AdjustLogLevel.VERBOSE);
setLogLevel: String

The level of logging you want to enable.

  • adjustConfig.setLogLevel(AdjustLogLevel.VERBOSE): enable all logging
  • adjustConfig.setLogLevel(AdjustLogLevel.DEBUG): disable verbose logging.
  • adjustConfig.setLogLevel(AdjustLogLevel.INFO): the default: Log information, warnings, and errors.
  • adjustConfig.setLogLevel(AdjustLogLevel.WARN): log only errors and warnings.
  • adjustConfig.setLogLevel(AdjustLogLevel.ERROR): log only errors.
  • adjustConfig.setLogLevel(AdjustLogLevel.ASSERT);: disable errors.
  • adjustConfig.setLogLevel(AdjustLogLevel.SUPPRESS);: disable all logging.

Sample initialization snippet

To initialize the Adobe AIR SDK v5, adapt the following code sample:

package {
import com.adjust.sdk.Adjust;
import com.adjust.sdk.AdjustConfig;
import com.adjust.sdk.AdjustEnvironment;
import com.adjust.sdk.AdjustLogLevel;
public class Example extends Sprite {
public function Example() {
var appToken:String = "{YourAppToken}";
var environment:String = AdjustEnvironment.SANDBOX;
var adjustConfig:AdjustConfig = new AdjustConfig(appToken, environment);
adjustConfig.setLogLevel(AdjustLogLevel.VERBOSE);
Adjust.initSdk(adjustConfig);
}
}
}

Android permissions

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.

YOURAPP-app.xml
<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.

COPPA (Children's Online Privacy Protection Act) compliance

  • com.google.android.gms.permission.AD_ID is bundled in the Adjust SDK for Android. You can remove it with the following snippet:
YOURAPP-app.xml
<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.

Changes and removals

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.

Changed APIs

Changed in v5

The following APIs have changed in Adobe AIR SDK v5.

Disable and enable the SDK

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

Offline mode

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.
Adjust.switchToOfflineMode(); // set the SDK to offline mode
Adjust.switchBackToOnlineMode(); // set the SDK back to online mode

Send information in background

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 adjustConfig instance. This feature is disabled by default.

adjustConfig.enableSendingInBackground();

Set attribution callback

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 to getAdgroup().

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());
});

Event deduplication

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");

Push tokens

In Adobe AIR SDK v5, the setDeviceToken method has been renamed to setPushToken.

Adjust.setPushToken("push-token");

Session callback parameters

In Adobe AIR SDK v5, the session callback parameters have been renamed to global callback parameters.

To add global callbacks to your sessions, call the Adjust.addGlobalCallbackParameter method with the following arguments:

key: String

The key of your parameter.

value: String

The value of your parameter.

Learn how to set up global callback.

Adjust.addGlobalCallbackParameter("user_id", "855");
Adjust.removeGlobalCallbackParameter("user_id");
Adjust.removeGlobalCallbackParameters();

Session partner parameters

In Adobe AIR SDK v5, the session partner parameters have been renamed to global partner parameters.

To add global partner to your sessions, call the Adjust.addGlobalPartnerParameter method with the following arguments:

key: String

The key of your parameter.

value: String

The value of your parameter.

Learn how to set up global partner parameters.

Adjust.addGlobalPartnerParameter("user_id", "855");
Adjust.removeGlobalPartnerParameter("user_id");
Adjust.removeGlobalPartnerParameters();

Session and event callbacks

Session success callbacks

In Adobe AIR SDK v5, the setSessionTrackingSucceededDelegate method has been renamed to setSessionSuccessCallback.

The getTimeStamp() method has been renamed to getTimestamp().

To register a successful session recording by the SDK, call the setSessionSuccessCallback with any of the following properties:

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());
});

Session failure callbacks

In Adobe AIR SDK v5, the setSessionTrackingFailedDelegate method has been renamed to setSessionFailureCallback.

The getTimeStamp() method has been renamed to getTimestamp().

To register a failed session recording by the SDK, call the setSessionFailureCallback with any of the following properties:

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());
});

Event success callbacks

In Adobe AIR SDK v5, the setEventTrackingSucceededDelegate method has been renamed to setEventSuccessCallback.

The getTimeStamp() method has been renamed to getTimestamp().

To register a successful event recording by the SDK, call the setEventSuccessCallback with any of the following properties:

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());
});

Event failure callbacks

In Adobe AIR SDK v5, the setEventTrackingFailedDelegate method has been renamed to setEventFailureCallback.

The getTimeStamp() method has been renamed to getTimestamp().

To register a failed event recording by the SDK, call the setEventFailureCallback with any of the following properties:

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);
}

Learn how to reattribute users with direct deep links.

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);
});

Learn how to work with deferred deep link callbacks.

iOS only APIs

SKAdNetwork handling

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();

App Tracking Transparency authorization wrapper

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);
});

Get device information

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 ID

Adjust ID getter
Adjust.getAdid(function (adid:String):void {
trace("Adjust ID = " + adid);
});

Amazon Advertising ID

Amazon ADID getter
Adjust.getAmazonAdId(function (amazonAdId:String):void {
trace("Amazon Advertising ID = " + amazonAdId);
});

Apple's Identifier for Advertisers (IDFA)

IDFA getter
Adjust.getIdfa(function (idfa:String):void {
trace("IDFA = " + idfa);
});

Get attribution information

In Adobe AIR SDK v4, the attribution information getter methods run synchronously.

In SDK v5, the following methods have been changed to run asynchronously.

Attribution

Attribution getter
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());
});

Removed APIs

Removed in v5

The following APIs have been removed from Adobe AIR SDK v5.

  • The setDelayStart method has been removed.
  • The setEventBufferingEnabled method has been removed.
  • The setReadMobileEquipmentIdentity method has been removed. (non-Google Play Store Android apps only)

Disable third party sharing globally

The disableThirdPartySharing method has been removed.

To enable or disable all third-party sharing in Adobe AIR SDK v5, use the trackThirdPartySharing method.

var adjustThirdPartySharing:AdjustThirdPartySharing = new AdjustThirdPartySharing("false");
Adjust.trackThirdPartySharing(adjustThirdPartySharing);

Set an app secret

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.

Huawei referrer API

This feature has been removed. If your Adobe AIR app uses the Huawei referrer API, contact your Adjust representative or email support@adjust.com before you upgrade.