configure method

Future<bool> configure(
  1. String apiKey, {
  2. String? baseURL,
})

Configure VietmapTrackingSDK with API key

Must be called before using any tracking features.

apiKey - API key for VietmapTrackingSDK baseURL - Optional base URL for the API

Returns true if configuration was successful

Implementation

Future<bool> configure(String apiKey, {String? baseURL}) async {
  _logSection('Configure SDK');
  try {
    debugPrint(
      'API key: ${apiKey.isEmpty ? 'empty' : 'provided'} | baseURL: ${baseURL ?? 'default'}',
    );
    final result = await _platform.configure(apiKey, baseURL);
    _isConfigured = result;
    return result;
  } catch (e) {
    debugPrint('Failed to configure VietmapTrackingSDK: $e');
    return false;
  } finally {
    _logSection('Configure SDK', end: true);
  }
}