init static method

void init(
  1. String appId,
  2. String serverUrl
)

Initialize the SDK. The track function is not available until this interface is invoked.

appId the APP ID of your project.

serverUrl your own receiver's url. In case of using TA SaaS, the serverUrl is https://receiver.ta.thinkingdata.cn.

Implementation

static void init(String appId, String serverUrl) async {
  ThinkingAnalyticsAPI instance =
       ThinkingAnalyticsAPI.getInstance(appId, serverUrl);
  if (!_sInstances.containsKey(appId)) {
    _sInstances[appId] = instance;
  }
}