trackLaunch static method

void trackLaunch({
  1. required LaunchType type,
  2. required Uri uri,
  3. dynamic onTrack(
    1. LaunchType type,
    2. Uri uri
    )?,
})

Tracks a successful launch event.

Implementation

static void trackLaunch({
  required LaunchType type,
  required Uri uri,
  Function(LaunchType type, Uri uri)? onTrack,
}) {
  _launchCounts[type] = (_launchCounts[type] ?? 0) + 1;
  _lastLaunchTimestamps[type] = DateTime.now();

  developer.log(
    'Launch tracked: Type=$type, URI=$uri, Count=${_launchCounts[type]}',
    name: 'Launchify.Analytics',
  );

  onTrack?.call(type, uri);
}