initializeOpenAd function

Future<void> initializeOpenAd(
  1. String unitId,
  2. String screenDoNotWantToShow
)

Initializes an open ad on the native side with the given unitId and specifies a screenDoNotWantToShow where the ad should not be shown.

Implementation

Future<void> initializeOpenAd(
    String unitId, String screenDoNotWantToShow) async {
  const MethodChannel platform = MethodChannel('firebase_admob');
  try {
    await platform.invokeMethod('InitializeOpenAd',
        {"id": unitId, "screenName": screenDoNotWantToShow});
  } on PlatformException catch (e) {
    if (kDebugMode) {
      print("Failed to initialize open ad: '${e.message}'");
    }
  }
}