Configuration
Use the methods in this guide to configure the behavior of the Adtrace iOS SDK.
The SDK supports two kinds of configuration:
| Type | When you set it | Can change after init? |
|---|---|---|
| Read-only | On ADTConfig before appDidLaunch | No |
| Dynamic | On Adtrace at any time after the SDK starts | Yes |
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
| Parameter | Type | Description |
|---|---|---|
appToken | String | Your Adtrace app token from the Adtrace panel. |
environment | String | Use ADTEnvironmentSandbox for testing, or ADTEnvironmentProduction for release. |
allowSuppressLogLevel | BOOL / Bool | Optional. Set YES / true if you want to allow ADTLogLevelSuppress. |
Example
- Objective-C
- Swift
NSString *appToken = @"{YourAppToken}";
NSString *environment = ADTEnvironmentSandbox;
ADTConfig *adtraceConfig = [ADTConfig configWithAppToken:appToken
environment:environment];
// Configure read-only options on adtraceConfig here, then:
[Adtrace appDidLaunch:adtraceConfig];
let appToken = "{YourAppToken}"
let environment = ADTEnvironmentSandbox
let adtraceConfig = ADTConfig(appToken: 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.