getValueFromManifestOrInfoPlist method

  1. @override
Future<String> getValueFromManifestOrInfoPlist({
  1. String? androidManifestKey,
  2. String? iOSPlistKey,
})
override

This method is used to get the value from the manifest or info.plist based on the platform.

Implementation

@override
Future<String> getValueFromManifestOrInfoPlist(
    {String? androidManifestKey, String? iOSPlistKey}) async {
  String? val = FlyConstants.empty;
  try {
    if (Platform.isAndroid) {
      val = await mirrorFlyMethodChannel
          .invokeMethod('getManifestValue', {'key': androidManifestKey});
      LogMessage.d('getValueFromManifestOrInfoPlist Android', ' $val');
      return val ?? FlyConstants.empty;
    } else if (Platform.isIOS) {
      val = await mirrorFlyMethodChannel
          .invokeMethod('getPlistValue', {'key': iOSPlistKey});
      LogMessage.d('getValueFromManifestOrInfoPlist iOS', ' $val');
      return val ?? FlyConstants.empty;
    } else {
      return val;
    }
  } on PlatformException catch (e) {
    LogMessage.d("Platform Exception =", " $e");
    // rethrow;
    return FlyConstants.empty;
  } on Exception catch (error) {
    LogMessage.d("Exception ", " $error");
    // rethrow;
    return FlyConstants.empty;
  }
}