App Open Ads resemble interstitial ads but show when the user soft launches or cold starts the app:
Fire OS Applications are not supported.
Always consider retention when you implement the App Open Ad format.
For app open ads, you can choose from a variety of implementation strategies.
AppLovin recommends that you test by using one or more of the techniques described below. Each application has a unique configuration that allows it to maximize revenue without impacting retention or time spent in the app. User behavior and engagement may change, so AppLovin recommends that you retest your App Open Ads strategies often. Some implementation techniques you may use to test App Open Ads include:
To ensure your app open ad is ready when the user brings your application to the foreground, you should preload a MaxAppOpenAd.
Create a utility class and instantiate it in your Application class.
Then that class can make ad requests before you need to show your ad.
Create a method that shows an ad if ready.
Call this method inside the Lifecycle.Event.ON_START lifecycle event.
Your app then attempts to show an ad on app open, or loads an ad if one is not preloaded.
To be notified of app foregrounding events, register a LifecycleObserver.
You may need to add a lifecycle library to your application-level build.gradle file:
implementation("androidx.lifecycle:lifecycle-process:2.2.0")
There is a delay between when you request an ad and when you receive an ad to show. If you do not design your app well, the user may briefly see your app and then be surprised by an out-of-context ad. Prevent this bad user experience. You can handle cold starts by showing a loading screen before any app content, and then showing the ad after the loading screen. If your app shows any app content after the loading screen, do not show the ad.
You may have a loading screen under the app open ad, and that loading screen completes before the user dismisses the ad.
If so, you can dismiss your loading screen in the onAdHidden() method.
This code example assumes that app open ads show only on “soft launch,” when your app is suspended in memory. It does not include the splash/loading screen. The App Developer must handle the splash/loading screen—see Best practices.
public class MyApplication extends Application
{
private final ExampleAppOpenManager appOpenManager;
@Override
public void onCreate()
{
super.onCreate();
AppLovinSdk.initializeSdk( this, new AppLovinSdk.SdkInitializationListener()
{
@Override
public void onSdkInitialized(final AppLovinSdkConfiguration configuration)
{
appOpenManager = new ExampleAppOpenManager( MyApplication.this );
}
} );
}
}
public class ExampleAppOpenManager
implements DefaultLifecycleObserver, MaxAdListener
{
private final MaxAppOpenAd appOpenAd;
private final Context context;
public ExampleAppOpenManager(final Context context)
{
ProcessLifecycleOwner.get().getLifecycle().addObserver( this );
this.context = context;
appOpenAd = new MaxAppOpenAd( "«ad-unit-ID»", this );
appOpenAd.setListener( this );
appOpenAd.loadAd();
}
private void showAdIfReady()
{
if ( appOpenAd == null || !AppLovinSdk.getInstance( context ).isInitialized() ) return;
if ( appOpenAd.isReady() )
{
appOpenAd.showAd( "«test-placement»" );
}
else
{
appOpenAd.loadAd();
}
}
@Override
public void onStart(@NonNull LifecycleOwner owner)
{
showAdIfReady();
}
@Override
public void onAdLoaded(final MaxAd ad) {}
@Override
public void onAdLoadFailed(final String adUnitId, final MaxError error) {}
@Override
public void onAdDisplayed(final MaxAd ad) {}
@Override
public void onAdClicked(final MaxAd ad) {}
@Override
public void onAdHidden(final MaxAd ad)
{
appOpenAd.loadAd();
}
@Override
public void onAdDisplayFailed(final MaxAd ad, final MaxError error)
{
appOpenAd.loadAd();
}
}class MyApplication : Application()
{
private lateinit var appOpenManager: ExampleAppOpenManager
override fun onCreate()
{
super.onCreate()
AppLovinSdk.getInstance( this ).initializeSdk({ configuration: AppLovinSdkConfiguration ->
appOpenManager = ExampleAppOpenManager(applicationContext)
})
}
}
class ExampleAppOpenManager(applicationContext: Context?) : DefaultLifecycleObserver, MaxAdListener
{
private lateinit var appOpenAd: MaxAppOpenAd
private lateinit var context: Context
init
{
ProcessLifecycleOwner.get().lifecycle.addObserver(this)
context = applicationContext
appOpenAd = MaxAppOpenAd("«ad-unit-ID»", this)
appOpenAd.setListener(this)
appOpenAd.loadAd()
}
private fun showAdIfReady()
{
if (appOpenAd == null || !AppLovinSdk.getInstance(context).isInitialized) return
if (appOpenAd.isReady)
{
appOpenAd.showAd("«test-placement»")
}
else
{
appOpenAd.loadAd()
}
}
override fun onStart(owner: LifecycleOwner)
{
showAdIfReady()
}
override fun onAdLoaded(ad: MaxAd) {}
override fun onAdLoadFailed(adUnitId: String, error: MaxError) {}
override fun onAdDisplayed(ad: MaxAd) {}
override fun onAdClicked(ad: MaxAd) {}
override fun onAdHidden(ad: MaxAd)
{
appOpenAd.loadAd()
}
override fun onAdDisplayFailed(ad: MaxAd, error: MaxError)
{
appOpenAd.loadAd()
}
}| Ad network | Minimum adapter version |
|---|---|
| BIGO Ads | 4.5.1.0 |
| Google Bidding and Google AdMob | 22.2.0.2 |
| Liftoff Monetize | 6.12.0.2 |
| Mintegral | 16.6.61.1 |
| Pangle | 4.6.0.4.0 |