initialize static method

Future<void> initialize()

Initializes the background location tracking service.

This method must be called before any other BackgroundLocator methods. It sets up the native platform channels and prepares the service for receiving location updates.

Throws a PlatformException if initialization fails on the native side.

Implementation

static Future<void> initialize() async {
  final CallbackHandle callback =
      PluginUtilities.getCallbackHandle(callbackDispatcher)!;
  await _channel.invokeMethod(Keys.METHOD_PLUGIN_INITIALIZE_SERVICE,
      {Keys.ARG_CALLBACK_DISPATCHER: callback.toRawHandle()});
}