configureAppMonitoringService method

  1. @override
Future<bool> configureAppMonitoringService({
  1. UsageInterval interval = UsageInterval.daily,
  2. int lookbackTimeMs = 10000,
})
override

Configures the app monitoring service with the specified interval and lookback time

Parameters:

  • interval: The interval to use for usage stats queries (DAILY, WEEKLY, MONTHLY, YEARLY, BEST)
  • lookbackTimeMs: How far back in time to look for app usage data (in milliseconds)

Returns true if the service was configured successfully, false otherwise

Implementation

@override
Future<bool> configureAppMonitoringService({
  UsageInterval interval = UsageInterval.daily,
  int lookbackTimeMs = 10000, // Default: 10 seconds
}) async {
  final result = await methodChannel.invokeMethod<bool>(
    MethodName.configureAppMonitoringService,
    {
      Argument.interval: interval.name,
      Argument.lookbackTimeMs: lookbackTimeMs,
    },
  );
  return result ?? false;
}