Skip to main content

Flutter

Last updated 10/03/2026

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 nameDescriptionVersion requirement
thinking_analyticsCollects and processes data>= 3.3.1
td_remote_configFetches configuration from the AE backend>= 1.0.0
td_strategyProvides 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 nameTypeDescription
channelMsgTypeStringChannel message type
appIdStringThe app id of your AE project
pushIdStringChannel send ID of the operation task
taskIdStringID of the operation task
contentMapPush content of the operation task
userParamsMapCustom parameters in the client channel
opsPropertiesMapChannel information carried by the client-triggered task, used as receipt parameters for touch funnel events.
Was this page helpful?