startApiTracking method

Future<String?> startApiTracking({
  1. required String url,
  2. required String method,
})

Starts tracking an API call. Returns a Future resolving to the trackId issued by the native SDK, or null if tracking could not be started (URL excluded, native error, or framework unavailable).

Pair every successful start with a matching endApiTracking call once the response arrives. The native SDK measures latency between these two calls — call start at the real request begin to capture accurate timing.

Implementation

Future<String?> startApiTracking({
  required String url,
  required String method,
}) {
  if (_shouldExclude(url)) {
    return Future<String?>.value(null);
  }
  return AppticsFlutterPlatform.instance.startApiTracking(
    url: url,
    method: method,
  );
}