initialize static method

Future<void> initialize({
  1. required String apiKey,
  2. required String baseUrl,
  3. bool debug = false,
  4. bool autoCaptureEnabled = true,
  5. bool androidAnrWatchdogEnabled = false,
  6. int androidAnrTimeoutMs = 5000,
})

Initialize the Smart Grow Logs SDK

Implementation

static Future<void> initialize({
  required String apiKey,
  required String baseUrl,
  bool debug = false,
  bool autoCaptureEnabled = true,
  bool androidAnrWatchdogEnabled = false,
  int androidAnrTimeoutMs = 5000,
}) async {
  try {
    await _channel.invokeMethod('initialize', {
      'apiKey': apiKey,
      'baseUrl': baseUrl,
      'debug': debug,
      'autoCaptureEnabled': autoCaptureEnabled,
      'androidAnrWatchdogEnabled': androidAnrWatchdogEnabled,
      'androidAnrTimeoutMs': androidAnrTimeoutMs,
    });
  } on PlatformException catch (e) {
    if (kDebugMode) {
      debugPrint(
        "Smart Grow Logs ✉️: PlatformException during initialization: ${e.message}",
      );
    }
    throw Exception("Failed to initialize SmartGrowLogs: ${e.message}");
  }
}