Skip to main content

Configuration

Use the methods in this guide to configure the behavior of the Adtrace iOS SDK.

The SDK supports two kinds of configuration:

TypeWhen you set itCan change after init?
Read-onlyOn ADTConfig before appDidLaunchNo
DynamicOn Adtrace at any time after the SDK startsYes

Create an ADTConfig instance

Read-only options live on an ADTConfig object. Create that object, set the options you need, then pass it to [Adtrace appDidLaunch:] / Adtrace.appDidLaunch(...).

Required parameters

ParameterTypeDescription
appTokenStringYour Adtrace app token from the Adtrace panel.
environmentStringUse ADTEnvironmentSandbox for testing, or ADTEnvironmentProduction for release.
allowSuppressLogLevelBOOL / BoolOptional. Set YES / true if you want to allow ADTLogLevelSuppress.

Example

AppDelegate.m
NSString *appToken = @"{YourAppToken}";
NSString *environment = ADTEnvironmentSandbox;
ADTConfig *adtraceConfig = [ADTConfig configWithAppToken:appToken
environment:environment];
// Configure read-only options on adtraceConfig here, then:
[Adtrace appDidLaunch:adtraceConfig];

Replace {YourAppToken} with your app token from the Adtrace panel.

Read-only configuration

Read-only options are set on your ADTConfig instance before SDK initialization. They cannot be changed while the SDK is running.

You must configure any options you need before calling appDidLaunch.

Dynamic configuration

Dynamic configuration options can change after the SDK has started. Call these methods on Adtrace at any time during the SDK lifecycle.

Unlike read-only options on ADTConfig, you do not need to restart the SDK to apply a dynamic change.

Next steps

After you configure ADTConfig, initialize and test your integration in Getting started with the iOS SDK, then track actions with Event tracking.