initialiseSDK method

  1. @override
Future<Map<String, dynamic>> initialiseSDK(
  1. String apiKey,
  2. String cipherKey,
  3. String userID
)
override

Initialize the SDK with given API key, cipherKey, and userID

Implementation

@override
Future<Map<String, dynamic>> initialiseSDK(
  String apiKey,
  String cipherKey,
  String userID,
) async {
  try {
    final result = await methodChannel.invokeMapMethod<String, dynamic>(
      'initialiseSDK',
      {'apiKey': apiKey, 'cipherKey': cipherKey, 'userID': userID},
    );
    return result ?? {'success': false, 'errormessage': 'Unknown error'};
  } on PlatformException catch (e) {
    debugPrint('Failed to initialize SDK: ${e.message}');
    return {
      'success': false,
      'errormessage': e.message ?? 'Platform exception',
    };
  } catch (e) {
    debugPrint('Error in initialiseSDK: $e');
    return {'success': false, 'errormessage': e.toString()};
  }
}