initializeTracking method

Future<void> initializeTracking({
  1. required String trackingApiKey,
  2. String trackingBaseUrl = 'https://live.fleetwork.vn/api/v1',
})

Validate the tracking API key against the server and initialize the SDK.

Calls GET {trackingBaseUrl}/gps-tracking/users with the API key. Throws PlatformException with code "INVALID_API_KEY" if the key is rejected. On success the SDK is initialized automatically.

Must be called before startTracking. Can be called independently of configureTracking.

Implementation

Future<void> initializeTracking({
  required String trackingApiKey,
  String trackingBaseUrl = 'https://live.fleetwork.vn/api/v1',
}) async {
  await _method.invokeMethod<void>('initializeTracking', {
    'trackingApiKey': trackingApiKey,
    'trackingBaseUrl': trackingBaseUrl,
  });
}