Skip to content

App open Ads

App Open ad is a type of mobile advertisement designed to appear when a user opens a mobile app. These ads are full-screen and are typically displayed in a transition moment, such as when an app is launched or brought to the foreground.

This guide shows you how to integrate App open ads into your app.

Load ad

Create an instance of CTSplash, passing in the placementId and calling the loadAd method.

java

CTAdRequest adRequest = new CTAdRequest.Builder()
    .setPlacementId("SPLASH_PLACEMENT_ID")// [necessary] placementId from carty publisher
    .setMute(true)// [optional] does video ads mute play, sdk default value true
    .build();
CTSplash ctSplash = new CTSplash(adRequest);
ctSplash.loadAd();
kotlin

val adRequest = CTAdRequest.Builder()
    .setPlacementId("SPLASH_PLACEMENT_ID")// [necessary] placementId from carty publisher
    .setMute(true)// [optional] does video ads mute play, sdk default value true
    .build()
val ctSplash = CTSplash(adRequest)
ctSplash.loadAd()

Register Listener

It is recommended to register a listener before calling the CTSplash.loadAd method.

java

ctSplash.setSplashAdListener(new CTSplashAdListener() {
    @Override
    public void onLoaded(CTBaseAd baseAd) {
    }

    @Override
    public void onLoadFailed(CTAdError adError) {
    }

    @Override
    public void onShown(CTBaseAd baseAd) {
    }

    @Override
    public void onShowFailed(CTBaseAd baseAd, CTAdError adError) {
    }

    @Override
    public void onClicked(CTBaseAd baseAd) {
    }

    @Override
    public void onClosed(CTBaseAd baseAd) {
    }
});
kotlin

ctSplash.setSplashAdListener(object : CTSplashAdListener {
    override fun onLoaded(baseAd: CTBaseAd?) {
    }

    override fun onLoadFailed(adError: CTAdError?) {
    }

    override fun onShown(baseAd: CTBaseAd?) {
    }

    override fun onShowFailed(baseAd: CTBaseAd?, adError: CTAdError?) {
    }

    override fun onClicked(baseAd: CTBaseAd?) {
    }

    override fun onClosed(baseAd: CTBaseAd?) {
    }
})

Display ad

Call showAd on the CTSplash object that you instantiated

java

ctSplash.showAd(activity);
kotlin

ctSplash.showAd(activity)

Client-side bidding

After the ad loads successfully, you can obtain ecpm by calling CTBaseAd.getEcpm

java

baseAd.getEcpm();
kotlin

baseAd.ecpm

After winning the ad bid, call onC2SBiddingSuccess and pass in the second-highest bid from this bid.

java

ctSplash.onC2SBiddingSuccess("secondPrice", null);
kotlin

ctSplash.onC2SBiddingSuccess("$secondPrice", null)

After an ad is lost, onC2SBiddingFailed is called with the highest bid received in the auction.

java

ctSplash.onC2SBiddingFailed("topPrice", null);
kotlin

ctSplash.onC2SBiddingFailed("$topPrice", null)

Examples on GitHub