promoteToForeground static method

Future<void> promoteToForeground(
  1. String title, {
  2. String subTitle = "",
  3. bool showWhen = false,
  4. String description = "Service is running",
})

promote the service to foreground

Implementation

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

  return await _bgMethodChannel.invokeMethod(
      'service.promoteToForeground', data);
}