ADJConfig class

Use the ADJConfig class to store settings for use with the Adjust SDK.

Important:
You need to set up the ADJConfig class before you initialize the Adjust SDK. This is because the SDK copies properties from this class at runtime.

Class methods

Set up the SDK with the ADJConfig class

Important:
You need to call this method to set up the SDK.

To set up the SDK, you need to pass information about your app to your config object. You need to specify your app token, environment, and log level.

+ (nullable ADJConfig *) configWithAppToken: (nonnull NSString *) appToken
                                environment: (nonnull NSString *) environment
                      allowSuppressLogLevel: (BOOL) allowSuppressLogLevel 
Objective-C
Swift
Javascript
NSString *yourAppToken = @"{YourAppToken}";
NSString *environment = ADJEnvironmentSandbox;
ADJConfig *adjustConfig = [ADJConfig configWithAppToken:yourAppToken environment:environment allowSuppressLogLevel:YES];

Parameters

Values

Returns

Instance methods

Prevent communication with SKAdNetwork

By default, the Adjust SDK will share information with Apple's SKAdNetwork. You can disable this behavior if you do not plan to share this information with Apple.

- (void) deactivateSKAdNetworkHandling
Swift
Objective-C
let yourAppToken = "{YourAppToken}"
let environment = ADJEnvironmentSandbox as? String
let myConfig = ADJConfig(
    appToken: yourAppToken,
    environment: environment)
//...
myConfig.deactivateSKAdNetworkHandling()
//...
Adjust.appDidLaunch(myConfig)

Properties

Enable/disable reading of AdServices framework data

If you have added AdServices.framework to your app, the Adjust SDK will have access to AdServices information. To prevent this, toggle the allowAdServicesInfoReading property.

Note:
This property is set to true by default
- (BOOL) allowAdServicesInfoReading
Objective-C
Swift
[adjustConfig setAllowAdServicesInfoReading:NO];

Enable/disable reading of iAd framework data

By default, the Adjust SDK will read information from the iAd framework for use with ASA tracking. You can disable this by toggling the allowiAdInfoReading property.

Important:
The iAd framework was sunset by Apple on February 7th 2023. This property no longer has any effect.
- (BOOL) allowiAdInfoReading
Objective-C
Swift
[adjustConfig setAllowiAdInfoReading:NO];

Enable/disable reading of IDFA

The Adjust SDK will read the ID for Advertisers (IDFA) from a device to improve attribution accuracy. Toggle the allowIdfaReading property to prevent this.

Note:
This property is set to true by default
- (BOOL) allowIdfaReading
Objective-C
Swift
[adjustConfig allowIdfaReading:NO];

Set the default tracker for organic installs

You can set a default tracker for your app. The Adjust SDK will use this tracker when there is no other tracker information to read.

- (NSString *) defaultTracker
Objective-C
Swift
Javascript
[adjustConfig setDefaultTracker:@"{TrackerToken}"];

Parameters

Delay the launch of the SDK

Some information may not be available until after your app has launched. If you need to wait for the data to become available, you can delay the SDK's first launch. You can specify the number of seconds to delay the launch by.

Important:
This delay only applies to the session following a user opening the app for the first time. After this session, the SDK will initialize on app launch without a delay.
- (double) delayStart
Objective-C
Swift
Javascript
[adjustConfig setDelayStart:5.5];

Parameters

Set up a delegate to record changes to attribution

The Adjust SDK can notify you of changes to user attribution. To enable this, register a delegate to record these changes. This information will be accessible as a JSON object.

Note:
Since Adjust considers a number of different sources for attribution, this information is not provided in real-time.
- (NSObject< AdjustDelegate > *) delegate
Objective-C
Swift
Javascript
[adjustConfig setDelegate:self];

Parameters

Enable event buffering

If you are triggering a lot of events in your app, you may want to enable event buffering. Event buffering staggers the sending of events. When enabled, the Adjust SDK sends events once per minute rather than in real-time. The buffer will hold events until the Adjust SDK sends them to the Adjust backend.

- (BOOL) eventBufferingEnabled
Objective-C
Swift
Javascript
[adjustConfig setEventBufferingEnabled:YES];

Change the logging level

You can change the level of logging you receive from the Adjust SDK by changing the logLevel property. Some log levels are only available when you are running the application in a sandboxed environment.

- (ADJLogLevel) logLevel
Objective-C
Swift
Javascript
[adjustConfig setLogLevel:ADJLogLevelVerbose];

Parameters

Values

Require sending of cost data with attribution

The Adjust SDK enables you to specify if you need to send cost data as part of attribution.

- (BOOL) needsCost
Objective-C
Swift
[adjustConfig setNeedsCost:YES];

Enable sending of data in the background

By default, the Adjust SDK will only send event information when the app is open in the foreground. You can enable the SDK to send events when the app is running in the background.

- (BOOL) sendInBackground
Objective-C
Swift
Javascript
[adjustConfig setSendInBackground:YES];

Set external device ID

You can add a custom device identifier to track devices and users in your BI system. This external device identifier can be set to any value you choose.

You may need to delay your SDK initialization until your identifier is obtained.

Note:
The externalDeviceId has a lower priority than other identifiers such as advertising ID, so it only works for new devices. Existing devices will continue to be attributed by higher-ranked identifiers.
- (NSString *) externalDeviceId
Objective-C
Swift
Javascript
[adjustConfig setExternalDeviceId:@"yourExternalDeviceId"];

Set URL strategy

The Adjust SDK can use the url strategy setting to prioritise regional endpoints. You can use this if you are making use of the data residency feature.

- (NSString *) urlStrategy
Objective-C
Swift
Javascript
[adjustConfig setUrlStrategy:ADJDataResidencyEU];

Values