App Open Ads - san-sdk/sample GitHub Wiki

This guide is intended for publishers integrating app open ads using the SAN SDK.

App open ads are a special ad format intended for publishers wishing to monetize their app load screens. App open ads can be closed at any time, and are designed to be shown when your users bring your app to the foreground.

Prerequisites

  1. Already has a PlacementId using the format Splash.
  2. Follow our steps to Integrate the SAN SDK into your project.
  3. Integrated the SAN Ad SDK
  4. SDK version >= 3.13.1.2

Step 1.Load App Open Ads in Your App

SANSplashAd splashAd = new SANSplashAd(context, placementId);
splashAd.setMute(true);// Set the video to play on mute by default
splashAd.setTimeoutMills(5000);// Set the load timeout duration
splashAd.setAdLoadListener(new IAdListener.AdLoadListener() {
    @Override
    public void onAdLoaded(SANAd adWrapper) {
        // Called when the ad for the given placementId has loaded and is ready to be shown.
    }

    @Override
    public void onAdLoadError(AdError adError) {
        // Called when a ad fails to load for the given placementId. 
        // You can route to your main page when an error occured.
    }
});
splashAd.setAdActionListener(new IAdListener.AdActionListener() {
    @Override
    public void onAdImpressionError(AdError error) {
        // Called when an ad show failed. 
    }

    @Override
    public void onAdImpression() {
        // Called when an ad shown
    }

    @Override
    public void onAdClicked() {
        // Called when interstitial is clicked
    }

    @Override
    public void onAdCompleted() {

    }

    @Override
    public void onAdClosed(boolean hasRewarded) {
        // Called when a splash ad is closed.
    }
});
splashAd.load();//Request Ad

Step 2. Display Ad

splashAd.show();