AdPlayDeveloper Docs
Core runtime

AdPlayManager

AdPlayManager is responsible for SDK initialization, server requests, image downloading, active ad caching, display, and engagement reporting.

Initializes the SDKPrepares the token, network layer, and active ad cache.
Gets ads from AdPlay serverRequests active ad content for the selected format.
Downloads ad imagesFetches creative assets before rendering them in Unity UI.
Caches active adsKeeps active content available during the session.
Ad units

Supported ad formats

Visual ad methods receive an AdPlayTemplate, while interstitial sound plays without a template. All methods return AdRequestInfo.

Splash

Full-entry ad for launch, loading, or pre-menu moments.

GetSplash.cs
var result = await AdPlayManager.GetSplash(template);

Banner

Small persistent placement for menus, stores, or calm screens.

GetBanner.cs
var result = await AdPlayManager.GetBanner(template);

PopUp

A larger template-driven ad, useful after transitions or on menu screens.

GetPopUp.cs
var result = await AdPlayManager.GetPopUp(template);

PopUp Button

Shows only a button first. The popup opens after the player clicks.

GetPopUpButton.cs
var result = await AdPlayManager.GetPopUpButton(buttonTemplate, OnClick);

Interstitial Sound

Plays an interstitial audio ad without creating a UI template.

GetInterstitialSound.cs
var result = await AdPlayManager.GetInterstitialSound();
MethodUse forTemplate requirements
AdPlayManager.GetSplash(template)Full-screen or launch-time splash adImage
AdPlayManager.GetBanner(template)Banner placement in a CanvasImage
AdPlayManager.GetPopUp(template)Clickable popup ad with optional title, description, and button textImage, Button, RectTransform
AdPlayManager.GetPopUpButton(template, onClick)Button-style entry point that can open a PopUp when clickedImage, Button
AdPlayManager.GetInterstitialSound()Interstitial audio ad without UI template setupNone
Rendering layer

AdPlayTemplate

Templates are Unity UI prefabs that AdPlay fills with ad content.

FieldTypeUse
rectTransformRectTransformControls ad size and layout.
imageImageDisplays the ad creative image.
clickButtonButtonHandles ad click interaction.
titleTextRTLTextMeshProDisplays the ad title.
descriptionTextRTLTextMeshProDisplays the ad body text.
clickButtonTextRTLTextMeshProDisplays the call-to-action label.
Recommended hierarchy
Canvas
└── AdContainer
    └── AdPlayTemplate
        ├── AdImage
        ├── TitleText
        ├── DescriptionText
        └── ClickButton
            └── ButtonText
Response model

Results and errors

Every ad method returns AdRequestInfo so developers can handle empty inventory and integration mistakes.

AdRequestInfo.cs
bool IsSuccess;
AdRequestResultState State;
string ErrorMessage;
SuccessNoActiveAd - destroy the unused template and continue gameplayMissingRequiredTemplateField - fix Inspector referencesAdPlayIsNotInitialized - wait for OnGetAdsComplete
Sample implementation

SampleTest script

This sample shows how to wait for ads to finish loading, enable the test UI, instantiate templates, and call each supported ad method.

SampleTest.cs
using Adplay.Behaviours;
using Adplay.View;
using UnityEngine;

public class SampleTest : MonoBehaviour
{
    [SerializeField] private Transform canvas;
    [SerializeField] private AdPlayTemplate templatePrefab;
    [SerializeField] private GameObject infoGameObject, sampleTestGameObject;
    [SerializeField] private Transform buttonParent;

    private void OnEnable()
    {
        AdPlayManager.OnGetAdsComplete += OnGetAdsComplete;
    }

    private void OnDisable()
    {
        AdPlayManager.OnGetAdsComplete -= OnGetAdsComplete;
    }

    private void OnGetAdsComplete()
    {
        infoGameObject.SetActive(false);
        sampleTestGameObject.SetActive(true);
    }

    public async void ShowPopUpButton()
    {
        var buttonTemplate = Instantiate(templatePrefab, canvas);

        var result = await AdPlayManager.GetPopUpButton(
            buttonTemplate,
            async () =>
            {
                var template = Instantiate(templatePrefab, canvas);
                var popupResult = await AdPlayManager.GetPopUp(template);

                if (!popupResult.IsSuccess)
                    Debug.Log("No pop up");
            });

        if (!result.IsSuccess)
            Debug.Log("No pop up button");
    }

    public async void ShowSplash()
    {
        var template = Instantiate(templatePrefab, canvas);
        var result = await AdPlayManager.GetSplash(template);

        if (!result.IsSuccess)
            Debug.Log("No splash");
    }

    public async void ShowBanner()
    {
        var template = Instantiate(templatePrefab, canvas);
        var result = await AdPlayManager.GetBanner(template);

        if (!result.IsSuccess)
            Debug.Log("No banner");
    }

    public async void ShowPopUp()
    {
        var template = Instantiate(templatePrefab, canvas);
        var result = await AdPlayManager.GetPopUp(template);

        if (!result.IsSuccess)
            Debug.Log("No pop up");
    }

    public async void ShowInterstitialSound()
    {
        var result = await AdPlayManager.GetInterstitialSound();

        if (!result.IsSuccess)
        {
            Debug.Log("No interstitial sound");
        }
    }
}
Developer API

Public methods

These are the methods developers should use directly.

await AdPlayManager.GetSplash(AdPlayTemplate template) await AdPlayManager.GetBanner(AdPlayTemplate template) await AdPlayManager.GetPopUp(AdPlayTemplate template) await AdPlayManager.GetPopUpButton(AdPlayTemplate template, Action onClick) await AdPlayManager.GetInterstitialSound()