enableAppOpenAd method

void enableAppOpenAd()

Enables app-open ads.

Registers a WidgetsBindingObserver that automatically shows an app-open ad when the app returns to foreground.

Does nothing if AdConfig.appOpenId is null.

Implementation

void enableAppOpenAd() {
  _assertInitialized();
  if (_config.appOpenId == null) return;
  if (_appOpenEnabled) return;

  _appOpenEnabled = true;
  _lifecycleHandler = LifecycleHandler(
    onStateChanged: _onAppLifecycleChanged,
  );
  _lifecycleHandler!.register();
}