start static method

Future<int> start()

Start the background-fetch API.

Your callback Function provided to configure will be executed each time a background-fetch event occurs. NOTE the configure method automatically calls start. You do not have to call this method after you first configure the plugin.

Implementation

static Future<int> start() {
  Completer completer = Completer<int>();
  _methodChannel.invokeMethod('start').then((dynamic status) {
    completer.complete(status);
  }).catchError((dynamic e) {
    var message = "Unknown error";
    if (e.details != null) {
      message = e.details.toString();
    }
    completer.completeError(message);
  });
  return completer.future as Future<int>;
}