An interstitial is a full-screen ad that can be hidden by the user.
Create an interstitial adding your Tappx key and load the ad as per the example below.
TappxInterstitial tappxInterstitial = new TappxInterstitial(this, "**YOUR-APP-KEY**");
tappxInterstitial.setAutoShowWhenReady(true);
tappxInterstitial.loadAd();
val tappxInterstitial = TappxInterstitial(this, "**YOUR-APP-KEY**")
tappxInterstitial.setAutoShowWhenReady(true)
tappxInterstitial.loadAd()
Then request it and show it as soon as possible, using the setAutoShowWhenReady method.
tappxInterstitial.setAutoShowWhenReady(true);
tappxInterstitial!!.setAutoShowWhenReady(true)
To have more control over your interstitial ads, you can use loadAd, isReady, and show.
TappxInterstitial tappxInterstitial = new TappxInterstitial(this, "**YOUR-APP-KEY**");
tappxInterstitial.setAutoShowWhenReady(false);
tappxInterstitial.loadAd();
val tappxInterstitial = TappxInterstitial(this, "**YOUR-APP-KEY**")
tappxInterstitial.setAutoShowWhenReady(false)
tappxInterstitial.loadAd()
loadAd requests and loads all the information so you can show the ad.
tappxInterstitial.loadAd();
tappxInterstitial.loadAd()
isReady lets you check if the ad is ready to be displayed. You will receive a “true” if it is ready, and a “false” if not.
tappxInterstitial.isReady();
tappxInterstitial.isReady()
show lets you display the interstitial ad that has loaded previously.
tappxInterstitial.show();
tappxInterstitial.show()
TIP: we recommend sending additional information with your ad requests to improve performance. Check Advanced Settings section.
tappxInterstitial.setListener(new TappxInterstitialListener() {
@Override
public void onInterstitialLoaded(TappxInterstitial tappxInterstitial) {
Log.v("Tappx", "Tappx: onInterstitialLoaded");
}
@Override
public void onInterstitialLoadFailed(TappxInterstitial tappxInterstitial, TappxAdError tappxAdError) {
Log.v("Tappx", "Tappx: onInterstitialLoadFailed");
}
@Override
public void onInterstitialShown(TappxInterstitial tappxInterstitial) {
Log.v("Tappx", "Tappx: onInterstitialShown");
}
@Override
public void onInterstitialClicked(TappxInterstitial tappxInterstitial) {
Log.v("Tappx", "Tappx: onInterstitialClicked");
}
@Override
public void onInterstitialDismissed(TappxInterstitial tappxInterstitial) {
Log.v("Tappx", "Tappx: onInterstitialDismissed");
}
});
tappxInterstitial.setListener(object : TappxInterstitialListener {
override fun onInterstitialLoaded(tappxInterstitial: TappxInterstitial) {
Log.v("TappxSDK", "Tappx: onInterstitialLoaded")
}
override fun onInterstitialLoadFailed(tappxInterstitial: TappxInterstitial,
tappxAdError: TappxAdError) {
Log.v("TappxSDK", "Tappx: onInterstitialLoadFailed")
}
override fun onInterstitialShown(tappxInterstitial: TappxInterstitial) {
Log.v("TappxSDK", "Tappx: onInterstitialShown")
}
override fun onInterstitialClicked(tappxInterstitial: TappxInterstitial) {
Log.v("TappxSDK", "Tappx: onInterstitialClicked")
}
override fun onInterstitialDismissed(tappxInterstitial: TappxInterstitial) {
Log.v("TappxSDK", "Tappx: onInterstitialDismissed")
}
})
Please, if you don’t have an Endpoint contact our supply team at sdk@tappx.com.
You can set your Endpoint when requesting ads from your app project. Add the following lines:
tappxInterstitial.loadAd(new AdRequest().setEndpoint("[ENDPOINT]"));
tappxInterstitial.loadAd(AdRequest().setEndpoint("[ENDPOINT]"))