Flutter
Latest version: v1.0.0
Update time: 2025-12-08
1. Overview
Starting from AE 4.4, the Engage module provides the client-triggered task feature, which supports millisecond-level triggering in in-app scenarios such as new user registration and character creation, as well as real-time A/B splitting. On the client side, the ThinkingData SDK communicates with the AE backend to fetch and evaluate tasks.
Integrate the ThinkingData SDK into your app. On the app side, you only need to handle interactions with the ThinkingData SDK and don't need to care about task details in the AE backend.
2. Integration
Add the following dependencies to the pubspec.yaml file of your Flutter project:
dependencies:
thinking_analytics: ^3.3.1
td_remote_config: ^1.0.0
td_strategy: ^1.0.0
Client-triggered tasks depend on the following ThinkingData SDKs:
| SDK name | Description | Version requirement |
|---|---|---|
| thinking_analytics | Collects and processes data | >= 3.3.1 |
| td_remote_config | Fetches configuration from the AE backend | >= 1.0.0 |
| td_strategy | Provides client-side triggering | >=1.0.0 |
3. Initialization
import 'package:thinking_analytics/td_analytics.dart';
import 'package:td_remote_config/remote_config.dart';
import 'package:td_strategy/strategy.dart';
TDAnalytics.init("appId", "serverUrl");
TDRemoteConfig.init("appId", "serverUrl");
//Option 1
TDStrategy.init("appId", "serverUrl");
//Option 2
TDStrategySettings strategySettings = TDStrategySettings();
strategySettings.appId = "appId";
strategySettings.serverUrl = "serverUrl";
TDStrategy.initWithConfig(strategySettings);
4. Set a callback listener
After the SDK is initialized, set a callback listener for the TDStrategy SDK.
TDStrategy.setTriggerListener((tdStrategyResult) {
});
4.1 Callback data model
The type of tdStrategyResult is Map<String, dynamic>. Its properties are described below:
| Property name | Type | Description |
|---|---|---|
| channelMsgType | String | Channel message type |
| appId | String | The app id of your AE project |
| pushId | String | Channel send ID of the operation task |
| taskId | String | ID of the operation task |
| content | Map | Push content of the operation task |
| userParams | Map | Custom parameters in the client channel |
| opsProperties | Map | Channel information carried by the client-triggered task, used as receipt parameters for touch funnel events. |

