initializeMonnify method

  1. @override
Future<String?> initializeMonnify({
  1. required String apiKey,
  2. required String contractCode,
  3. required ApplicationMode appMode,
})
override

Implementation

@override
Future<String?> initializeMonnify(
    {required String apiKey,
    required String contractCode,
    required ApplicationMode appMode}) async {
  //get the app mode
  final String mode = _getAppMode(appMode);

  //initialize the map to send to server
  final map = {
    AppStrings.apiKey: apiKey,
    AppStrings.contractCodeKey: contractCode,
    AppStrings.appModeKey: mode
  };

  try {

    final result =
        await methodChannel.invokeMethod(AppStrings.initializeMonnify, map);

    return result;

  } catch (error) {

    rethrow;

  }
}