App Open
Integration
Below we show a few simple examples to implement the App Open ads by following the two possible ways of integration:
Manual
import 'package:wortise/app_open_ad.dart';
AppOpenAd _appOpenAd;
// Create an App Open
_appOpenAd = AppOpenAd('Wortise Ad Unit ID', listener: (event, args) {
// This listener will be invoked when an event happens
});
// Request an ad
await _appOpenAd.loadAd();
/* ... */
// Show the ad if available
if (await _appOpenAd.isAvailable) {
await _appOpenAd.showAd();
}The AppOpenAd class constructor allows to specify the following optional parameters to configure its behaviour:
Alternatively, the tryToShowAd() method can be used to show the ad with the difference that, if there is none available, the load of a new ad is automatically requested.
Via Manager
In this integration, the ads will be automatically shown when an app transitions from background to foreground. Also, the methods offered by AppOpenAd can still be used to show ads on demand.
Listener events
The assigned listener to an AppOpenAd can receive the following events:
Última actualización