📪App Open
AdSter SDK also gives the option to load and show AppOpen ad format which is the proprietary Ad format of Google Ad Manager and AdMob. Implementation is similar to that given in this document https://developers.google.com/admob/android/app-open. Instead of creating a new AppOpenAdManager
mentioned in the document use the method below provided by AdSter SDK and follow the implementation on the Activity and Application class just like the document. AdSter SDK provides methods to show and load app-open ads
Create your AdRequestConfiguration
as per the below format
val configuration = AdRequestConfiguration.Companion.builder(context, "Your_placement_name");
Load App Open Ad
Call loadAd()
method as per below format
AdSterAdLoader.Companion.builder().withAdsListener(new MediationAdListener() {
@Override
public void onFailure(@NonNull AdError adError) {
//Handle failure callback here
}
@Override
public void onAppOpenAdLoaded(@NonNull MediationAppOpenAd ad) {
super.onAppOpenAdLoaded(ad);
//Show App Open Ad here
}
}).withAppOpenAdEventsListener(new AppOpenAdEventsListener() {
@Override
public void onAdClicked() {
// Callback when ad is clicked
}
@Override
public void onAdImpression() {
// Callback when ad is shown
}
@Override
public void onAdOpened() {
// Callback when ad is opened
}
@Override
public void onAdClosed() {
// Callback when ad is cloed
}
@Override
public void onFailure(@Nullable AdError adError) {
// Calback when there is failure
}
}).build().loadAd(configuration.build());
Show AppOpen Ad
Inside the onAppOpenAdLoaded
callback method invoke showAd(activity)
method of MediationAppOpenAd
object to show AdSter App Open ad above any activity as shown below
@Override
public void onAppOpenAdLoaded(@NonNull MediationAppOpenAd ad) {
super.onAppOpenAdLoaded(ad);
ad.showAd(activity);
}
Last updated
Was this helpful?