Advanced guide
1. Initialization parameters
The TDSettings configuration passed in during initialization is described below
1.1 TDSettings
| Property name | Type | Description |
|---|---|---|
| appId | NSString | app id of the project created in the AE backend |
| serverUrl | NSString | server url of the project created in the AE backend |
| mode | TDSDKMode | Enum of SDK running modes |
| enableLog | BOOL | Whether to enable log printing |
| remoteConfigFetchParams | NSDictionary | (Used by TDRemoteConfig) Custom request parameters for fetching configurations |
| encryptVersion | NSInteger | (Used by ThinkingSDK) Key version number when data encryption is enabled |
| encryptKey | NSString | (Used by ThinkingSDK) Public key information when data encryption is enabled |
| defaultTimeZone | NSTimeZone | (Used by ThinkingSDK) Time zone that the SDK uses to format time |
| instanceName | NSString | (Used by ThinkingSDK) Sets an alias for the data collection SDK instance |
| enableAutoPush | BOOL | (Used by ThinkingSDK) Whether to enable automatic collection of push clicks |
| enableAutoCalibrated | BOOL | (Used by ThinkingSDK) Whether to enable automatic time calibration |
1.2 TDSDKMode
| Enum values | Description |
|---|---|
| TDSDKModeNomal | Reports data normally, and the data is ingested. |
| TDSDKModeDebug | Reports collected data in Debug mode. The device id must be added to the test device list in the AE console. You can view the data collected in real time under AE console -> Debugger. Reported data is stored in the AE system. |
TDSDKModeDebugOnly | Reports collected data in DebugOnly mode. The device id must be added to the test device list in the AE console. You can view the data collected in real time under AE console -> Debugger. Reported data is not stored in the AE system. |
2. Client parameters
When you create a client-triggered task, you can fill in Client-side Conditions. For configuration details, see Create client-triggered tasks
The parameters available in Client-side Conditions come from the environment parameters that the client collects automatically and the client parameters that you set through the TDRemoteConfig SDK. After you set custom client parameters through the APIs provided by the TDRemoteConfig SDK, you can add them to the AE backend and use them in operation tasks.
Note: The names and types of the parameters you SET on the client must match the client parameters configured in the AE Engage backend.
Add client parameters
#import <TDRemoteConfig/TDRemoteConfig.h>
// Set client parameters, multiple settings will take the union
[TDRemoteConfig addClientParams:@{
@"key": @"value"
}];
Delete client parameters
[TDRemoteConfig removeClientParam:@"key"];
Get client parameters
// Get all client params
NSDictionary *dict = [TDRemoteConfig getClientParams];
// Get client parames value for key
id obj = [TDRemoteConfig getClientParamValueForKey:@"key"];
Client parameters with accumulated values
[TDRemoteConfig accumulateNum:@(1) toClientParamKey:@"number_type_key"];
3. Customize fetch timing
3.1 Automatic fetching
The SDK automatically fetches remote configuration data in the following scenarios
- App cold start
- App foreground/background switch, more than 6 hours after the previous one
- The ThinkingSDK account system changes, for example, on login or logout
3.2 Manual fetching
Call the SDK method manually to fetch remote configuration at any time
[TDStrategy fetch];
This API has internal rate limiting. Avoid fetching too frequently.
4. Touch funnel events
When you create a client-triggered channel, you can enable the touch funnel settings. For configuration details, see Channel Settings
After you enable the touch funnel, you can configure the event names associated with the funnel steps. You can then view the conversion data of the configured steps on the data details page of operation tasks that use this channel.
Events selected for Delivered and Clicked must meet the following requirements:
- The event must carry Engage-specific parameters. You can get these parameters from the opsProperties property of the TDStrategyResult object in the push content, and report them as follows:
#import <ThinkingSDK/ThinkingSDK.h>
- (void)tdStrategyDidTrigger:(TDStrategyResult *)result {
// Replace "ops_click" with your event name
[TDAnalytics track:@"ops_click" properties:result.opsProperties];
}
5. Send Test
To quickly verify the availability of a channel and the validity of a task, the SDK supports a test mode.
TDSettings *settings = [[TDSettings alloc] init];
// debug
settings.mode = TDSDKModeDebug;
settings.enableLog = YES;
settings.appId = @"APPID";
settings.serverUrl = @"SERVER_URL";
[TDApp startWithSetting:settings];
After you enable debug mode on the client, the client fetches test tasks every 5s. In the AE Engage module, you can create channel tests or task tests. While a task is waiting to be triggered, you can watch the progress nodes on the frontend page.
Related documentation: Send Test for tasks, Send Test for channels
Send tests for client-triggered tasks require test devices. You can select or add test devices in the test device list

