Full-screen ads displayed when the app launches or returns to the foreground.
Naturally displayed on app loading or splash screens.
Creating Instance and Setting Callbacks
Create a DaroAppOpenAd instance and set up callbacks.
import 'package:daro_flutter/daro_flutter.dart';
final appOpenAd = DaroAppOpenAd(adUnitId: '{YOUR_AD_UNIT_ID}');appOpenAd.onAdLoadSuccess = (adInfo) { print('App open ad loaded');};appOpenAd.onAdLoadFail = (error) { print('App open ad failed to load: ${error.message}');};appOpenAd.onAdImpression = (adInfo) { print('App open ad impression');};appOpenAd.onAdClicked = (adInfo) { print('App open ad clicked');};appOpenAd.onAdShown = (adInfo) { print('App open ad shown');};appOpenAd.onAdFailedToShow = (error) { print('App open ad failed to show: ${error.message}');};appOpenAd.onAdDismiss = (adInfo) { print('App open ad dismissed');};
Loading Ads
Call load() to load an ad.
appOpenAd.load();
Showing Ads
Check if the ad is ready with isReady(), then display it with show().
final isReady = await appOpenAd.isReady();if (isReady) { appOpenAd.show();}
Releasing Resources
Call dispose() to release resources when done.
appOpenAd.dispose();
Implementation Example
This is an example implementation of DaroAppOpenAd.