startService static method

Future<bool> startService(
  1. NotificationPayload options,
  2. ServiceType type, {
  3. AndroidCallServiceKind kind = AndroidCallServiceKind.call,
})

Starts the Android foreground service of type for the call in options.

For ServiceType.call, kind picks which Android service hosts the call, and so which foreground service types it requests. See AndroidCallServiceKind.

Implementation

static Future<bool> startService(
  NotificationPayload options,
  ServiceType type, {
  AndroidCallServiceKind kind = AndroidCallServiceKind.call,
}) async {
  if (!isAndroid) {
    return false;
  }
  return StreamVideoFlutterPlatform.instance.startBackgroundService(
    payload: options,
    type: type,
    kind: kind,
  );
}