AppOpenAdManager
is just a simple wrapper to handle the new AppOpenAd
Format by AdMob (Google).
If you look at the tutorial, you'll see the detailed guide to create a Helper Class
to manage AppOpenAd
.
The wrapper should have been included in the core Ads SDK itself but it wasn't, So I ended up creating the wrapper!
All that boilerplate, now wrapped to a Single line of Code for the developer.
val latest_version
:1.0
Gradle:
implementation 'com.lazygeniouz:aoa_manager:$latest_version'`
Maven:
<dependency>
<groupId>com.lazygeniouz</groupId>
<artifactId>aoa_manager</artifactId>
<version>$latest_version</version>
<type>pom</type>
</dependency>
Kotlin:
AppOpenManager(this, InitialDelay.NONE, adUnitId, adRequest, orientation)
Java:
new AppOpenManager(App.this, InitialDelay.NONE, adUnitId, adRequest, orientation);
The constructor arguments are:
-
@NonNull application: Application
Your class extendingandroid.app.Application
-
@NonNull initialDelay: InitialDelay
You can specify an Initial Delay to load & display the Ad for the first time.
If you do not need a delay, simple passInitialDelay.NONE
But it is a good practise to allow the user to first explore the App &
therefore 1 Day should be fine which is also the Default if you passInitialDelay()
-
adUnitId: String
YouradUnitId
(Optional for Testing) Default is a Test AdUnitId -
adRequest: AdRequest
(Optional) If you have a customised AdRequest -
orientation: Int
(Optional) Default isAppOpenAd.APP_OPEN_AD_ORIENTATION_PORTRAIT
Available variables are:
AppOpenAd.APP_OPEN_AD_ORIENTATION_PORTRAIT
AppOpenAd.APP_OPEN_AD_ORIENTATION_LANDSCAPE