4-3. Banner Ads for Unity

It is a rectangular image or text ad that occupies a portion of the screen. It remains visible on the screen while the user interacts with the app and automatically refreshes.

Before you begin

04. Unity-Plugin Guidechevron-right

ONEAdMax SDK Intitialize

ONEAdMax initialization is required before loading ads. The method ONEAdMaxClient.Initialize() must be executed only once.

...
using ONEAdMax;
...
public class ONEAdMaxDemo : MonoBehaviour
{
    private static bool _isInitialized = false;
    
    void Start()
    {
        if (!_isInitialized)
        {
            // Initialize the ONEAdMax SDK.
            ONEAdMaxClient.Initialize(() =>
            {
                // This callback is called once the ONEAdMax SDK is initialized.
                _isInitialized = true
            });
        }
    }
}

You can create an OAMBannerViewinstance and handle lifecycle events to extend its functionality.

Create a Banner View instance.

circle-check
Size
μƒμˆ˜(Constant)

320x50

AdSize.BANNER_320x50

300x250

AdSize.BANNER_300x250

320x100

AdSize.BANNER_320x100

Set the banner display animation.

Set the animation when the banner is displayed. (Default: AnimType.NONE) There are a total of 7 animations you can configure.

μ• λ‹ˆλ©”μ΄μ…˜ νƒ€μž… μ’…λ₯˜

μƒμˆ˜
μ„€λͺ…

AnimType.NONE

No animation (default)

AnimType.FADE_IN

Fade-in animation

AnimType.SLIDE_LEFT

Slide animation to the left

AnimType.SLIDE_RIGHT

Slide animation to the right

AnimType.TOP_SLIDE

Slide animation from the top

AnimType.BOTTOM_SLIDE

Slide animation from the bottom

AnimType.CIRCLE

Banner rotation animation

Set the network schedule timeout (optional)

Set the network schedule timeout for banner ads. (Default: 5 seconds) When loading ads, a timeout period is given for each network. If an ad is not received within that time, it will move to the next network.

Set the banner ad request refresh interval (optional)

Set the refresh interval for banner ads. (Default: 60 seconds) The configurable range is between 15 and 300 seconds, and if set to -1, the ad will not refresh automatically.

Fill the banner background color (optional)

You can fill the empty space of the banner view with a background color. (Default: true)

Set the banner mediation options (optional).

Supports configuration values for some mediation settings of the banner ads.

πŸ“ŒStarting Mediationchevron-right

Listen for events from the banner view (optional)

circle-exclamationONE AdMax SDK Error Codeschevron-right

Create a banner view.

Complete all the settings and create theOAMBannerView

Call the Load() API at the desired time to request an ad from the server for displaying the banner ad.

circle-exclamation

Stop displaying the banner ad.

Call it when you no longer want to display the banner ad.

triangle-exclamation

Check whether the banner ad is loaded.

Check whether the banner ad is loaded. (returns true | false)

Extend the application lifecycle.

Implement to check the onPause and onResume status of the application where the banner ad is being displayed.

circle-exclamation

Last updated