Before You Start
Before integrating ads unit in your app, you must:
- In the OpenMediation Publisher UI, create an account, create an app, and create an ad placement using the format 'Splash'. You can follow guides here.
- Follow our steps to Android SDK Integration by integrating the SDK into your project.
- If you use mediation, go to Add Mediation Networks and make sure you have added the ad network SDKs and the corresponding adapters you wish to use to your app.
Splash Ad
The Splash Ad takes APP launch as the exposure opportunity, and provides 3s~5s of advertising display time. The user can click the ad to jump to the target page, or click the "skip" button in the upper right corner to jump to the APP content homepage.
Step 1. Set the Splash Ad Listener(Please call after SDK initialization is successful)
The OpenMediation SDK fires several events to inform you of Promotion Ad activity, such as ad availability and completions, so you will know whether and when to reward your users. To serve Promotion Ad, you need to first set its listeners and process ad events. The following snippet demonstrates how to implement the SplashAdListener interface to receive video ad events.
The SDK will notify the listener of all possible events listed below:
import com.openmediation.sdk.splash.SplashAd;
import com.openmediation.sdk.splash.SplashAdListener;
import com.openmediation.sdk.utils.error.Error;
...
SplashAd.setSplashAdListener(placementId, new SplashAdListener() {
/**
* called when SplashAd loaded
*/
@Override
public void onSplashAdLoaded(String placementId) {
}
/**
* called when SplashAd load error
*/
@Override
public void onSplashAdFailed(String placementId, Error error) {
}
/**
* called when SplashAd clicked
*/
@Override
public void onSplashAdClicked(String placementId) {
}
/**
* called when SplashAd showed
*/
@Override
public void onSplashAdShowed(String placementId) {
}
/**
* called when SplashAd show failed
*
* @param error SplashAd show error reason
*/
@Override
public void onSplashAdShowFailed(String placementId, Error error) {
}
/**
* called when SplashAd countdown
* @param millisUntilFinished The time until the end of the countdown,ms
*/
@Override
public void onSplashAdTick(String placementId, long millisUntilFinished) {
}
/**
* called when SplashAd dismissed
*/
@Override
public void onSplashAdDismissed(String placementId) {
}
});
Step 2. Load the Promotion Ad
SplashAd.loadAd(String placementId);
Step 3. Show the Splash Ad
if (SplashAd.isReady(placementId)) {
SplashAd.showAd(placementId, viewGroup);
}
Done!
You are now all set to deliver Splash Ad in your app!
What's Next:
Follow our integration guides to integrate additional Rewarded Video Ad networks on our Mediation platform or configure additional Ad Units:
Comments
Article is closed for comments.