configureTracking method

Future<bool> configureTracking({
  1. required String apiKey,
  2. String baseUrl = 'https://tracking.vietmap.vn',
  3. AuthMode authMode = AuthMode.header,
  4. String gpsTrackingEndpoint = '/gps-tracking',
  5. String gpsBulkEndpoint = '/gps-tracking/bulk',
  6. bool autoUpload = true,
})

Configure the tracking SDK.

Must be called before any other method.

  • apiKey Your Vietmap API key.
  • baseUrl Override the default tracking server base URL.
  • authMode How credentials are sent (header or queryParam).
  • gpsTrackingEndpoint Relative path for single-point uploads.
  • gpsBulkEndpoint Relative path for batch uploads.
  • autoUpload Whether the SDK should auto-upload cached points.

Implementation

Future<bool> configureTracking({
  required String apiKey,
  String  baseUrl              = 'https://tracking.vietmap.vn',
  AuthMode authMode            = AuthMode.header,
  String  gpsTrackingEndpoint  = '/gps-tracking',
  String  gpsBulkEndpoint      = '/gps-tracking/bulk',
  bool    autoUpload           = true,
}) async {
  try {
    final result = await _method.invokeMethod<bool>('configureTracking', {
      'apiKey':               apiKey,
      'baseUrl':              baseUrl,
      'authMode':             authMode.name,
      'gpsTrackingEndpoint':  gpsTrackingEndpoint,
      'gpsBulkEndpoint':      gpsBulkEndpoint,
      'autoUpload':           autoUpload,
    });
    return result ?? false;
  } on PlatformException {
    rethrow;
  }
}