目录
此内容是否有帮助?

# Multi-Instance

The Multi-Appid feature could create multiple SDK instances to perform data tracking based on their own Appid. That is, you can report data to multiple Appids.

In the Cocos2d-x SDK version 2.1.0, a new Light-instance feature is added, which can support the generate of multiple sub-light instances of the same Appid. The sub-lightweight instance is consistent with the Appid of the parent instance, but the account number and other information are inconsistent.

Multiple SDK instances can be created by uploading different APP IDs to complete SDK initialization

// initialize SDK
ThinkingAnalyticsAPI::init(TE_APP_ID, TE_SERVER_URL);
ThinkingAnalyticsAPI::init(TE_APP_ID_1, TE_SERVER_URL_1);

TDJSONObject eventProperties;
eventProperties.setString("product_name", "product name");
ThinkingAnalyticsAPI::track("product_buy",eventProperties,TE_APP_ID);