disposeBannerAd method

Future<bool> disposeBannerAd(
  1. String bannerId
)

Disposes a banner ad and releases its resources.

bannerId - The unique ID of the banner ad to dispose.

Returns true if the banner is disposed successfully, false otherwise.

Implementation

Future<bool> disposeBannerAd(String bannerId) async {
  try {
    final result = await _channel.invokeMethod<bool>(
      'disposeBannerAd',
      {'bannerId': bannerId},
    );
    return result ?? false;
  } catch (e) {
    debugPrint('Error disposing banner ad: $e');
    return false;
  }
}