initialize static method

void initialize({
  1. double tapThreshold = 20.0,
  2. bool debug = false,
})

Initialize automatic interaction tracking. Called only when user set CXInstrumentationType.userActions to true in options. When user set it to false, CxFlutterPlugin.initSdk does not call this, so no detection runs.

Implementation

static void initialize({
  double tapThreshold = 20.0,  // Same as native iOS SDK
  bool debug = false,
}) {
  if (_isInitialized) return;

  _instance = CxInteractionTracker._(
    tapThreshold: tapThreshold,
    debug: debug,
  );

  _instance!._startListening();
  _isInitialized = true;

  if (debug) {
    debugPrint('[CxInteractionTracker] Initialized');
  }
}