startService static method

Future<bool?> startService({
  1. bool foreground = true,
  2. String subTitle = "",
  3. bool showWhen = false,
  4. String title = "Notification Listener",
  5. String description = "Service is running",
})

start the service

Implementation

static Future<bool?> startService({
  bool foreground = true,
  String subTitle = "",
  bool showWhen = false,
  String title = "Notification Listener",
  String description = "Service is running",
}) async {
  var data = {};
  data["foreground"] = foreground;
  data["subTitle"] = subTitle;
  data["showWhen"] = showWhen;
  data["title"] = title;
  data["description"] = description;

  var res = await _methodChannel.invokeMethod('plugin.startService', data);

  return res;
}