Skip to content

Initialization

Before any ads can be loaded or shown, AdMob must be initialized.
This step prepares the Google Mobile Ads SDK, configures the application with your App ID, and ensures that all ad formats (banner, interstitial, rewarded, and others) are ready to operate.

Initialization is required once, typically at the start of your game or when the first level loads.
Without initialization, no ad requests will work, and all loading functions will fail.


Initialize Ad Mob

This function must be called before loading or showing any ads.
Once triggered, the plugin starts the AdMob SDK and waits until the initialization is complete. This can sometimes take a little time (2 to 5 seconds).

When the SDK is ready, the On Completed callback is executed. You can pull from this pin and create a Custom Event to continue your logic, for example, to load a banner or an interstitial ad.

Parameters

1. On Completed

A delegate that is called after the AdMob SDK has finished initializing.
No data is returned — it simply confirms that the system is ready to load and show ads.

Use this pin to trigger any ad loading logic.


Is Ad Mob Ready

This function returns whether the AdMob SDK has finished initializing.
It is useful if you want to check the initialization state before attempting to load or show ads.

If the result is true, you can safely proceed with ad requests.
If it is false, you should wait until initialization completes.

Parameters

1. Return Value

A boolean value indicating whether AdMob is fully initialized.
- true — the SDK is ready to load and display ads
- false — initialization is still in progress or has not started


C++ Usage

All Blueprint functions are also available for use in C++.
You can initialize AdMob and check its state directly through static methods of UAdMobCPPLibrary.

InitializeAdMob

#include "AdMobCPPLibrary.h"

void UMyClass::InitAdMob()
{
    FOnAdMobInitializedNative OnCompleted;
    OnCompleted.BindLambda([]()
    {
        UE_LOG(LogTemp, Log, TEXT("AdMob initialized successfully."));
    });

    UAdMobCPPLibrary::InitializeAdMob(OnCompleted);
}

IsAdMobReady

#include "AdMobCPPLibrary.h"

void UMyClass::CheckAdMob()
{
    bool bIsReady = UAdMobCPPLibrary::IsAdMobReady();

    UE_LOG(LogTemp, Log, TEXT("Is AdMob ready? %s"),
        bIsReady ? TEXT("Yes") : TEXT("No"));
}