Common information

Appodeal supports all major mobile ad formats (C++ constants are in brackets):

  • Interstitial (AdType::INTERSTITIAL): full-screen ads, that contain a static image or a skippable video.
  • Rewarded video (AdType::REWARDED_VIDEO): non-skippable video ads that users may choose to watch to get a reward.
  • Non-skippable video (AdType::NON_SKIPPABLE_VIDEO): video ads that must be watched until the end.
  • Banner (AdType::BANNER): rectangular ads that occupy a spot within an app's layout.

Please note:

Ad types can be combined. Tick to select several ad types, for example, interstitial and non-skippable video.
To combine ad types in C++ use "|" operator: AdType::INTERSTITIAL | AdType::BANNER

Non-skippable and rewarded videos cannot be used simultaneously as non-skippable video is the alias of rewarded one. If you are not sure, which ad formats would suit you the best, check out our FAQ.

Handle callbacks in Blueprint

To handle ads callback events in blueprints, add Appodeal component to any desired Blueprint (one instance only for the whole project). Then add events to your Blueprint graph:

1. Open the Blueprint where you want to add the events.

2. Add Appodeal Component there.

3. Select Appodeal Component to display the Properties window.

4. Scroll down the window and press the plus button next the required event.

Handle callbacks in C++

  1. Add the AppodealComponent to your actor.
  2. Declare callback functions with required parameters (see below) and add UFUNCTION decorator for each function.
  3. In BeginPlay method of your Actor add dynamic delegates.

Example for OnRewardedVideoFinished:

UE4 onRewardedVideoFinished
UCLASS()
class APPODEALCPPDEMO_API YourActor : public AActor
{
    GENERATED_BODY()

public:
    UAppodealComponent *appodealComponent;
    YourActor(const FObjectInitializer& ObjectInitializer): Super(ObjectInitializer){
        appodealComponent = ObjectInitializer.CreateDefaultSubobject<UAppodealComponent>(this, TEXT("Appodeal"));
    }

    void BeginPlay(){
        Super::BeginPlay();
        if(appodealComponent){
            appodealComponent->OnRewardedVideoFinished.AddDynamic(this, &AAppodealActor::onRewardedVideoFinished);
        }
    }
    UFUNCTION()
    void onRewardedVideoFinished(float amount, FString name){
        FString message = FString::Printf(TEXT("Appodeal. On Rewarded Video Finished. Reward: %d %s" ), amount, *name);
        if(GEngine) GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Green, message);
    }
}

Interstitial

Display interstitial

To show interstitial, use Appodeal Show Action where you want and select the interstitial ad type.

C++

UE4 display interstitial
UAppodealComponent::show(AdType::INTERSTITIAL);

Check if interstitial is loaded

To check if ad is loaded, use Appodeal Is Loaded Action with interstitial ad type selected. It will return boolean value with ad state.

С++

UE4 interstitial is loaded
bool loaded = UAppodealComponent::isLoaded(AdType::INTERSTITIAL);


Cache interstitial manually

If you want to use manual ad caching, disable it before Initialization using Appodeal Disable Auto Cache Action and select the interstitial ad type.

Then use Appodeal Cache Action where you want to cache and select the interstitial ad type.

C++

UE4 cache interstitial manually
UAppodealComponent::setAutoCache(AdType::INTERSTITIAL, false);
UAppodealComponent::cache(AdType::INTERSTITIAL);

Interstitial events

For interstitial the following event types are available:

  • On Interstitial Loaded - called when interstitial is loaded.
  • On Interstitial Failed To Load - called when interstitial failed to load.
  • On Interstitial Shown - called when interstitial is shown.
  • On Interstitial Clicked - called when interstitial is clicked.
  • On Interstitial Closed - called when interstitial is closed.
  • On Interstitial Expired - called when interstitial expired.

Interstitial Events in C++

UE4 interstitial events
UFUNCTION()
void onInterstitialLoaded(bool isPrecache);
UFUNCTION()
void onInterstitialFailedToLoad();
UFUNCTION()
void onInterstitialShown();
UFUNCTION()
void onInterstitialClicked();
UFUNCTION()
void onInterstitialClosed();
UFUNCTION()
void onInterstitialExpired();

Rewarded video

Display rewarded video

To show rewarded video, use Appodeal Show Action where you want and select the rewarded video ad type.

C++

UE4 rewarded video display
UAppodealComponent::show(AdType::REWARDED_VIDEO);

Check if rewarded video is loaded

To check if ad is loaded, use Appodeal Is Loaded Action with rewarded video ad type selected. It will return boolean value with ad state.

C++

UE4 rewarded video is loaded
bool loaded = UAppodealComponent::isLoaded(AdType::REWARDED_VIDEO);

Cache ad manually

If you want to use manual ad caching, disable it before Initialization using Appodeal Disable Auto Cache Action and select the rewarded video ad type.

Then use Appodeal Cache Action where you want to cache rewarded video.

C++

UE4 rewarded video cache manually
UAppodealComponent::setAutoCache(AdType::REWARDED_VIDEO, false);
UAppodealComponent::cache(AdType::REWARDED_VIDEO);

Rewarded video events

For rewarded video the following event types are available:

  • On Rewarded Video Loaded - called when rewarded video is loaded.
  • On Rewarded Video Failed To Load - called when rewarded video failed to load.
  • On Rewarded Video Shown - called when rewarded video is shown.
  • On Rewarded Video Finished - called when rewarded video is viewed until the end, returns reward amount and reward name from Segment Settings.
  • On Rewarded Video Closed - called when rewarded video is closed.
  • On Rewarded Video Expired - called when rewarded video expired.

Rewarded Video Events in C++

UE4 rewarded video events
UFUNCTION()
void onRewardedVideoLoaded(bool isPrecache);
UFUNCTION()
void onRewardedVideoFailedToLoad();
UFUNCTION()
void onRewardedVideoShown();
UFUNCTION()
void onRewardedVideoFinished(float amount, FString name);
UFUNCTION()
void onRewardedVideoClosed(bool isFinished);
UFUNCTION()
void onRewardedVideoExpired();
UFUNCTION()
void onRewardedVideoClicked();


Non-skippable video

Display non-skippable video

To show non-skippable video, use Appodeal Show Action where you want and select the non-skippable video ad type.

C++

UE4 non skippable display
UAppodealComponent::show(AdType::NON_SKIPPABLE_VIDEO);

Check if non-skippable video is loaded

To check if ad is loaded, use Appodeal Is Loaded Action with non-skippable video ad type selected. It will return boolean value with ad state.

C++

UE4 non skippable is loaded
bool loaded = UAppodealComponent::isLoaded(AdType::NON_SKIPPABLE_VIDEO);

Cache non-skippable video manually

If you want to use manual ad caching, disable it before Initialization using Appodeal Disable Auto Cache Action and select the non-skippable video ad type.

Then use Appodeal Cache Action where you want to cache non-skippable video.

С++

UE4 non skippable cache manually
UAppodealComponent::setAutoCache(AdType::NON_SKIPPABLE_VIDEO, false);
UAppodealComponent::cache(AdType::NON_SKIPPABLE_VIDEO);

Non-skippable video events

  • On Non Skippable Video Loaded - called when non-skippable video is loaded.
  • On Non Skippable Video Failed To Load - called when non-skippable video failed to load.
  • On Non Skippable Video Shown - called when non-skippable video is shown.
  • On Non Skippable Video Finished -  called when non-skippable video is viewed until the end, returns reward amount and reward name from Segment Settings.
  • On Non Skippable Video Closed - called when non-skippable video is closed.
  • On Non Skippable Video Expired - called when non-skippable video expired.

Non Skippable Video Events in C++

UE4 non skippable events
UFUNCTION()
void onNonSkippableVideoLoaded(bool isPrecache);
UFUNCTION()
void onNonSkippableVideoFailedToLoad();
UFUNCTION()
void onNonSkippableVideoShown();
UFUNCTION()
void onNonSkippableVideoFinished();
UFUNCTION()
void onNonSkippableVideoClosed(bool isFinished);
UFUNCTION()
void onNonSkippableVideoExpired();


Banner

Display banner

To show banner, use Appodeal Show Action where you want and select the banner ad type.

C++

UE4 banner display
UAppodealComponent::show(AdType::BANNER_TOP);

Check if banner is loaded

To check if ad is loaded, use Appodeal Is Loaded Action with banner ad type selected. It will return boolean value with ad state.

С++

UE4 banner is loaded
bool loaded = UAppodealComponent::isLoaded(AdType::BANNER);

Cache banner manually

If you want to use manual ad caching, disable it before Initialization using Appodeal Disable Auto Cache Action and select the banner ad type.

Then use Appodeal Cache Action where you want to cache banner.

C++

UE4 banner cache manually
UAppodealComponent::setAutoCache(AdType::BANNER, false);
UAppodealComponent::cache(AdType::BANNER);

Banner events

  • On Banner Loaded - called when banner is loaded.
  • On Banner Failed To Load - called when banner video failed to load.
  • On Banner Shown  - called when banner is shown.
  • On Banner Clicked - called when banner is clicked.
  • On Banner Expired  - called when banner expired.

Banner Events in С++

UE4 banner events
UFUNCTION()
void onBannerLoaded(int height, bool isPrecache);
UFUNCTION()
void onBannerFailedToLoad();
UFUNCTION()
void onBannerShown();
UFUNCTION()
void onBannerClicked();
UFUNCTION()
void onBannerExpired();

Disable smart banners

Smart banners are the banner ads which automatically fit the screen size. Using them helps to deal with the increasing fragmentation of the screen sizes on different devices. In the Appodeal SDK the smart banners are enabled by default. You can disable them before Initialization using Appodeal Disable Smart Banners.

С++

UE4 disable smart banners
UAppodealComponent::setSmartBanners(false);