configureTracking method
Configure the tracking SDK.
Must be called before any other method.
apiKeyYour Vietmap API key.baseUrlOverride the default tracking server base URL.authModeHow credentials are sent (headerorqueryParam).gpsTrackingEndpointRelative path for single-point uploads.gpsBulkEndpointRelative path for batch uploads.autoUploadWhether 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;
}
}