Banner and MREC ads are rectangular ad formats that occupy part of an app’s layout—often at the top or bottom of the screen or inline in scrollable content. They remain visible as users interact with the app, which allows uninterrupted gameplay or use, and can refresh automatically after a set period.
The following sections show you how to load, show, and hide a banner or MREC ad.
To load a banner or MREC, call create_banner() or create_mrec().
Pass that method your Ad Unit ID, desired ad view position, and (for banners) desired background color.
MAX sizes the ad for you automatically:
The complete list of position options are:
top_lefttop_centertop_rightcenter_leftcenteredcenter_rightbottom_leftbottom_centerbottom_rightMAX automatically sizes banners to 320×50 on phones or 728×90 on tablets. It sizes MRECs to 300×250 on both phones and tablets.
To show a banner or MREC, call show_banner() or show_mrec():
To hide a banner or MREC, call hide_banner() or hide_mrec():
You may want to stop auto-refresh for an ad. For instance, you may want to do this when you hide an ad or you want to manually refresh. Stop auto-refresh with the following code:
Start auto-refresh for an ad with the following code:
“Why mobile banners ads persist in a video and playable world” from AppLovin’s Blog.