initialize method

  1. @override
Future<void> initialize(
  1. String publicKey,
  2. String environment
)
override

Implementation

@override
Future<void> initialize(String publicKey, String environment) async {
  try {
    await methodChannel.invokeMethod('initialize', {
      'publicKey': publicKey,
      'environment': environment,
    });
  } on PlatformException catch (e, stackTrace) {
    _logger.severe('Error initializing the SDK: ${e.message}', e, stackTrace);
    throw Exception('PlatformException: ${e.code}, ${e.message}');
  } catch (e, stackTrace) {
    _logger.severe('Unexpected error initializing the SDK', e, stackTrace);
    throw Exception('Unexpected error: $e');
  }
}