startForegroundService method

Future<MapxusMethodResponse> startForegroundService({
  1. required String appId,
  2. required String secret,
  3. String notificationTitle = 'Mapxus Positioning',
  4. String notificationContent = 'Location tracking is active',
})

Starts the Android foreground service so positioning continues after the app is closed. Events are delivered through the same events stream while the app is open, and through the setBackgroundHandler callback while the app is closed.

Implementation

Future<MapxusMethodResponse> startForegroundService({
  required String appId,
  required String secret,
  String notificationTitle = 'Mapxus Positioning',
  String notificationContent = 'Location tracking is active',
}) =>
    _platform.startForegroundService(
      appId: appId,
      secret: secret,
      notificationTitle: notificationTitle,
      notificationContent: notificationContent,
    );