Reward Videos



Rewarded Video: Unity (C#)




Rewarded Ads are usually full-screen video ads which users can view to receive a reward inside the application, like an additional in-game currency or a health bonus.

Example Usage

// Callbacks:

private void OnRewardGranted(Enhance.RewardType rewardType, int rewardValue) {
    if (rewardType == Enhance.RewardType.ITEM) {
        writeLog ("Reward granted (item)");
    } else if (rewardType == Enhance.RewardType.COINS) {
        writeLog ("Reward granted (coins)");
        writeLog ("Reward value: " + rewardValue);
    }
}

private void OnRewardDeclined() {
    writeLog ("Reward declined");
}

private void OnRewardUnavailable() {
    writeLog ("Reward unavailable");
}

if (Enhance.IsRewardedAdReady()) {
    // The ad is ready, show it
    Enhance.ShowRewardedAd (OnRewardGranted, OnRewardDeclined, OnRewardUnavailable);
}

Methods

bool Enhance.IsRewardedAdReady( string placement = Enhance.REWARDED_PLACEMENT_NEUTRAL )

Check if a rewarded ad from any of the included SDK providers is ready to be shown.

Parameters:
optional string placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Returns:
Returns true if any ad is ready, false otherwise.

void Enhance.ShowRewardedAd( string placement = Enhance.REWARDED_PLACEMENT_NEUTRAL, Action<RewardType, int> onRewardGrantedCallback, Action onRewardDeclinedCallback, Action onRewardUnavailableCallback )

Display a new rewarded ad if any is currently available. The ad provider is selected based on your app's mediation settings.

Parameters:
optional string placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Action<RewardType, int> onRewardGrantedCallback - Specifies the action which is triggered when a new reward is granted to the user. As parameters, this action will receive the reward type and value (only applicable if the reward type is Enhance.RewardType.COINS).

Action onRewardDeclinedCallback - Specifies the action which is triggered when a reward is declined by the user, for example: he closed the ad before its end.

Action onRewardUnavailableCallback - Specifies the action which is triggered when a reward is unavailable, because of the ad network error for example.

Members

string Enhance.REWARDED_PLACEMENT_SUCCESS

The ad is following a success in the game, such as completing a level.

string Enhance.REWARDED_PLACEMENT_HELPER

The ad is shown to help the user, for instance after losing a level.

string Enhance.REWARDED_PLACEMENT_NEUTRAL

The ad is shown in a neutral moment.

enum Enhance.RewardType.ITEM

The granted reward is a game-defined item.

enum Enhance.RewardType.COINS

The granted reward is a specified number of coins.

Rewarded Video: Android (Java)




Rewarded Ads are usually full-screen video ads which users can view to receive a reward inside the application, like an additional in-game currency or a health bonus.

Example Usage

if(Enhance.isRewardedAdReady()) {
    // The ad is ready, show it
    Enhance.showRewardedAd(new RewardCallback()
    {
        // Callbacks:

        @Override
        public void onRewardGranted(int rewardValue, RewardType rewardType)
        {
            if(rewardType == RewardType.ITEM)
                writeLog("Reward granted (item)");

            else if(rewardType == RewardType.COINS)
                writeLog("Reward granted (coins), value: " + rewardValue);
        }

        @Override
        public void onRewardDeclined()
        {
            writeLog("Reward declined");
        }

        @Override
        public void onRewardUnavailable()
        {
            writeLog("Reward unavailable");
        }   
    });    
}

Methods

boolean Enhance.isRewardedAdReady()

Check if a rewarded ad from any of the included SDK providers is ready to be shown.

Returns:
Returns true if any ad is ready, false otherwise.

boolean Enhance.isRewardedAdReady( String placement )

Check if a rewarded ad from any of the included SDK providers is ready to be shown.

Parameters:
String placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Returns:
Returns true if any ad is ready, false otherwise.

void Enhance.showRewardedAd( RewardCallback callbacks )

Display a new rewarded ad if any is currently available. The ad provider is selected based on your app's mediation settings.

Parameters:
RewardCallback callbacks - Specifies the callback which is triggered when a reward is granted, declined or unavailable (for more information about the RewardCallback type, see the Interfaces section).

void Enhance.showRewardedAd( Enhance.RewardCallback callbacks, String placement )

Display a new rewarded ad if any is currently available. The ad provider is selected based on your app's mediation settings.

Parameters:
Enhance.RewardCallback callbacks - Specifies the callback which is triggered when a reward is granted, declined or unavailable (for more information about the Enhance.RewardCallback type, see the Interfaces section).

String placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Interfaces

interface Enhance.RewardCallback { void onRewardGranted( int rewardValue, Enhance.RewardType rewardType ); void onRewardDeclined(); void onRewardUnavailable(); }


Members

String Enhance.REWARDED_PLACEMENT_SUCCESS

The ad is following a success in the game, such as completing a level.

String Enhance.REWARDED_PLACEMENT_HELPER

The ad is shown to help the user, for instance after losing a level.

String Enhance.REWARDED_PLACEMENT_NEUTRAL

The ad is shown in a neutral moment.

enum Enhance.RewardType.ITEM

The granted reward is a game-defined item.

enum Enhance.RewardType.COINS

The granted reward is a specified number of coins.

Rewarded Video: iOS (Objective-C)




Rewarded Ads are usually full-screen video ads which users can view to receive a reward inside the application, like an additional in-game currency or a health bonus.

Example Usage

-(void)onRewardGranted:(int)rewardValue rewardType:(RewardType)rewardType {
    if(rewardType == REWARDTYPE_ITEM) {
        [self writeLog:@"Reward granted (item)"];
    }
    else if(rewardType == REWARDTYPE_COINS) {
        [self writeLog:@"Reward granted (coins)"];
        [self writeLog:[NSString stringWithFormat:@"Reward value: %d", rewardValue]];
    }
}

-(void)onRewardDeclined {
    [self writeLog:@"Reward declined"];
}

-(void)onRewardUnavailable {
    [self writeLog:@"Reward unavailable"];
}

-(void)showAd {
    bool isRewardedAdReady = [Enhance isRewardedAdReady];
    
    if(isRewardedAdReady) {
        [Enhance showRewardedAd:self];        
    }   
}

Methods

BOOL [Enhance isRewardedAdReady]

Check if a rewarded ad from any of the included SDK providers is ready to be shown.

Returns:
Returns YES if any ad is ready, NO otherwise.

BOOL [Enhance isRewardedAdReady: (NSString*)placement ]

Check if a rewarded ad from any of the included SDK providers is ready to be shown.

Parameters:
NSString* placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Returns:
Returns YES if any ad is ready, NO otherwise.

void [Enhance showRewardedAd: (id)delegate ]

Display a new rewarded ad if any is currently available. The ad provider is selected based on your app's mediation settings.

Parameters:
id delegate - Specifies the object which implements the RewardDelegate protocol (for more information about this type, see the Protocols section).

void [Enhance showRewardedAd: (id)delegate placement:(NSString*)placement ]

Display a new rewarded ad if any is currently available. The ad provider is selected based on your app's mediation settings.

Parameters:
id delegate - Specifies the object which implements the RewardDelegate protocol (for more information about this type, see the Protocols section).

NSString* placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Protocols

protocol RewardDelegate<NSObject> -(void)onRewardGranted: (int)rewardValue rewardType:(RewardType)rewardType; -(void)onRewardDeclined; -(void)onRewardUnavailable;


Members

NSString* REWARDED_PLACEMENT_SUCCESS

The ad is following a success in the game, such as completing a level.

NSString* REWARDED_PLACEMENT_HELPER

The ad is shown to help the user, for instance after losing a level.

NSString* REWARDED_PLACEMENT_NEUTRAL

The ad is shown in a neutral moment.

enum REWARDTYPE_ITEM

The granted reward is a game-defined item.

enum REWARDTYPE_COINS

The granted reward is a specified number of coins.

Rewarded Video: OpenFL (Haxe)




Rewarded Ads are usually full-screen video ads which users can view to receive a reward inside the application, like an additional in-game currency or a health bonus.

Example Usage

// Callbacks:

var onRewardGranted = function(rewardType:String, rewardValue:Int) 
{ 
    if(rewardType == Enhance.REWARD_ITEM)
        _logOutput.writeLog("Reward granted (item)");

    else if(rewardType == Enhance.REWARD_COINS)
        _logOutput.writeLog("Reward granted (coins), value: " + rewardValue);
};

var onRewardDeclined = function() {
    _logOutput.writeLog("Reward declined");
};

var onRewardUnavailable = function() {
    _logOutput.writeLog("Reward unavailable");
};

if(Enhance.isRewardedAdReady()) {
    Enhance.showRewardedAd(onRewardGranted, onRewardDeclined, onRewardUnavailable);
}

Methods

Enhance.isRewardedAdReady( ?placement:String = Enhance.REWARDED_PLACEMENT_NEUTRAL ):Bool

Check if a rewarded ad from any of the included SDK providers is ready to be shown.

Parameters:
optional String placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Returns:
Returns true if any ad is ready, false otherwise.

Enhance.showRewardedAd( ?placement:String = REWARDED_PLACEMENT_NEUTRAL, onRewardGrantedCallback:String->Int->Void, onRewardDeclinedCallback:Void->Void, onRewardUnavailableCallback:Void->Void ):Void

Display a new rewarded ad if any is currently available. The ad provider is selected based on your app's mediation settings.

Parameters:
optional String placement - Specifies the placement of the ad (describes in what moment the ad is shown).

String->Int->Void onRewardGrantedCallback - Specifies the function which is triggered when a new reward is granted to the user. As parameters, this function will receive the reward type and value (only applicable if the reward type is Enhance.REWARD_COINS).

Void->Void onRewardDeclinedCallback - Specifies the function which is triggered when a reward is declined by the user, for example: he closed the ad before its end.

Void->Void onRewardUnavailableCallback - Specifies the function which is triggered when a reward is unavailable, because of the ad network error for example.

Members

Enhance.REWARDED_PLACEMENT_SUCCESS:String

The ad is following a success in the game, such as completing a level.

Enhance.REWARDED_PLACEMENT_HELPER:String

The ad is shown to help the user, for instance after losing a level.

Enhance.REWARDED_PLACEMENT_NEUTRAL:String

The ad is shown in a neutral moment.

Enhance.REWARD_ITEM:String

The granted reward is a game-defined item.

Enhance.REWARD_COINS:String

The granted reward is a specified number of coins.

Rewarded Video: Adobe Air (AS3)




Rewarded Ads are usually full-screen video ads which users can view to receive a reward inside the application, like an additional in-game currency or a health bonus.

Example Usage

private function onRewardGranted(type:String, value:int):void {
    if(type == Enhance.REWARD_ITEM) {
        writeLog("Reward granted (item)");
    } 

    else if(type == Enhance.REWARD_COINS) {
        writeLog("Reward granted (coins)");
        writeLog("Reward value: " + value);
    }
}

private function onRewardDeclined():void {
    writeLog("Reward declined");
}

private function onRewardUnavailable():void {
    writeLog("Reward unavailable");
}

private function showAd():void {
    if(Enhance.isRewardedAdReady()) {
        Enhance.showRewardedAd(onRewardGranted, onRewardDeclined, onRewardUnavailable);
    }
}

Methods

Enhance.isRewardedAdReady( placement:String = Enhance.REWARDED_PLACEMENT_NEUTRAL ):Boolean

Check if a rewarded ad from any of the included SDK providers is ready to be shown.

Parameters:
optional String placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Returns:
Returns true if any ad is ready, false otherwise.

Enhance.showRewardedAd( onRewardGrantedCallback:Function, onRewardDeclinedCallback:Function, onRewardUnavailableCallback:Function, placement:String = REWARDED_PLACEMENT_NEUTRAL ):void

Display a new rewarded ad if any is currently available. The ad provider is selected based on your app's mediation settings.

Parameters:
Function onRewardGrantedCallback - Specifies the function which is triggered when a new reward is granted to the user. As parameters, this function will receive the reward type and value (only applicable if the reward type is Enhance.REWARD_COINS).

Function onRewardDeclinedCallback - Specifies the function which is triggered when a reward is declined by the user, for example: he closed the ad before its end.

Function onRewardUnavailableCallback - Specifies the function which is triggered when a reward is unavailable, because of the ad network error for example.

optional String placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Members

Enhance.REWARDED_PLACEMENT_SUCCESS:String

The ad is following a success in the game, such as completing a level.

Enhance.REWARDED_PLACEMENT_HELPER:String

The ad is shown to help the user, for instance after losing a level.

Enhance.REWARDED_PLACEMENT_NEUTRAL:String

The ad is shown in a neutral moment.

Enhance.REWARD_ITEM:String

The granted reward is a game-defined item.

Enhance.REWARD_COINS:String

The granted reward is a specified number of coins.

Rewarded Video: Defold (Lua)




Rewarded Ads are usually full-screen video ads which users can view to receive a reward inside the application, like an additional in-game currency or a health bonus.

Example Usage

function show_ad()
    if enhance.isRewardedAdReady() then
        enhance.showRewardedAd(on_reward_granted, on_reward_declined, on_reward_unavailable)
    end
end

function on_reward_granted(self, reward_value, reward_type)
    if reward_type == "REWARDTYPE_ITEM" then
        write_log("Reward granted (item)")

    elseif reward_type == "REWARDTYPE_COINS" then
        write_log("Reward granted (coins), value: " .. reward_value)
    end
end

function on_reward_declined()
    write_log("Reward declined")
end

function on_reward_unavailable()
    write_log("Reward unavailable")
end

Methods

boolean enhance.isRewardedAdReady( string placement = "neutral" )

Check if a rewarded ad from any of the included SDK providers is ready to be shown.

Parameters:
optional string placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Returns:
Returns true if any ad is ready, false otherwise.

nil enhance.showRewardedAd( string placement = "neutral" function onRewardGrantedCallback, function onRewardDeclinedCallback, function onRewardUnavailableCallback )

Display a new rewarded ad if any is currently available. The ad provider is selected based on your app's mediation settings.

Parameters:
optional string placement - Specifies the placement of the ad (describes in what moment the ad is shown).

function onRewardGrantedCallback - Specifies the function which is triggered when a new reward is granted to the user. As parameters, this action will receive the reward value and type (value is only applicable if the reward type is "REWARDTYPE_COINS").

function onRewardDeclinedCallback - Specifies the function which is triggered when a reward is declined by the user, for example: he closed the ad before its end.

function onRewardUnavailableCallback - Specifies the function which is triggered when a reward is unavailable, because of the ad network error for example.

Members

"REWARDTYPE_ITEM"

The granted reward is a game-defined item.

"REWARDTYPE_COINS"

The granted reward is a specified number of coins.

Rewarded Video: Construct 2 (Visual)




Rewarded Ads are usually full-screen video ads which users can view to receive a reward inside the application, like an additional in-game currency or a health bonus.

Example Usage

System On start of layout
    Enhance Show rewarded ad with placement neutral

Enhance On rewarded ad failed
    Function Call "writeLog" ("Rewarded ad is not ready")

Enhance On reward granted
    System Enhance.LastRewardType = "item"
        Function Call "writeLog" ("Reward granted (item)")
    System Else
    System Enhance.LastRewardType = "coins"
        Function Call "writeLog" ("Reward granted (coins)")

Actions

Enhance Show rewarded ad

Display a new rewarded ad if any is currently available. The ad provider is selected based on your app's mediation settings. If this action fails for any reason, the On rewarded ad failed condition will be triggered.

Parameters:
optional placement - Specifies the placement of the ad (describes in what moment the ad is shown). The default value is neutral.

Conditions

Enhance On rewarded ad failed

Triggered when Enhance failed to show the ad (e.g. received no fill error from the ad network).

Enhance On reward granted

Triggered when a reward is granted to the user. To fetch more information about the reward, use the Enhance.LastRewardType and Enhance.LastRewardValue expressions.

Enhance On reward declined

Triggered when a reward is declined by the user.

Enhance On reward unavailable

Triggered when a reward is unavailable.

Expressions

string Enhance.LastRewardType

Type of the latest granted reward. The value will be either "item" or "coins".

number Enhance.LastRewardValue

Value of the latest granted reward. Only applicable if Enhance.LastRewardType is "coins".

Rewarded Video: Cordova (JS)




Rewarded Ads are usually full-screen video ads which users can view to receive a reward inside the application, like an additional in-game currency or a health bonus.

Example Usage

var callback = function(result) {
    if(!result) {
        app.writeLog('Rewarded ad is not ready');
        return;
    }

    // The ad is ready
    var onRewardGranted = function(rewardValue, rewardType) {
        if(rewardType == Enhance.RewardType.ITEM) 
            app.writeLog("Reward granted (item)");

        else if(rewardType == Enhance.RewardType.COINS)
            app.writeLog("Reward granted (coins), value: " + rewardValue);
    };

    var onRewardDeclined = function() {
        app.writeLog('Reward declined');
    };

    var onRewardUnavailable = function() {
        app.writeLog('Reward unavailable');
    };

    Enhance.showRewardedAd(onRewardGranted, onRewardDeclined, onRewardUnavailable);
};

Enhance.isRewardedAdReady(callback);

Methods

void Enhance.isRewardedAdReady( resultCallback, placement = 'neutral' )

Check if a rewarded ad from any of the included SDK providers is ready to be shown.

Parameters:
function resultCallback - Specifies the function which will receive a response (true or false).

optional string placement - Specifies the placement of the ad (describes in what moment the ad is shown).

void Enhance.showRewardedAd( onRewardGrantedCallback, onRewardDeclinedCallback, onRewardUnavailableCallback, placement = 'neutral' )

Display a new rewarded ad if any is currently available. The ad provider is selected based on your app's mediation settings.

Parameters:
function onRewardGrantedCallback - Specifies the function which is triggered when a new reward is granted to the user. As parameters, this function will receive the reward type and value (only applicable if the reward type is Enhance.RewardType.COINS).

function onRewardDeclinedCallback - Specifies the function which is triggered when a reward is declined by the user, for example: he closed the ad before its end.

function onRewardUnavailableCallback - Specifies the function which is triggered when a reward is unavailable, because of the ad network error for example.

optional string placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Members

string Enhance.Placement.SUCCESS

The ad is following a success in the game, such as completing a level.

string Enhance.Placement.HELPER

The ad is shown to help the user, for instance after losing a level.

string Enhance.Placement.NEUTRAL

The ad is shown in a neutral moment.

string Enhance.RewardType.ITEM

The granted reward is a game-defined item.

string Enhance.RewardType.COINS

The granted reward is a specified number of coins.

Rewarded Video: Stencyl (Visual)




Rewarded Ads are usually full-screen video ads which users can view to receive a reward inside the application, like an additional in-game currency or a health bonus.

Example Usage


Action Blocks



Display a new rewarded ad if any is currently available. The ad provider is selected based on your app's mediation settings.



Display a new rewarded ad if any is currently available. The ad provider is selected based on your app's mediation settings.

Parameters:
text placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Normal Blocks



Check if a rewarded ad from any of the included SDK providers is ready to be shown.

Returns:
Returns true if any ad is ready, false otherwise.



Check if a rewarded ad from any of the included SDK providers is ready to be shown.

Parameters:
text placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Returns:
Returns true if any ad is ready, false otherwise.



Access the type of the latest reward.

Returns:
Returns either "ITEM" or "COINS".



Access the value of the latest reward. Only applicable if a reward type is "COINS".

Returns:
Returns a numeric value.

Wrapper Blocks



Define actions which are triggered when a reward is granted to the user. To fetch informations about the reward, use the last reward type and last reward value blocks.



Define actions which are triggered when a reward is declined by the user.



Define actions which are triggered when a reward is unavailable.

Rewarded Video: Construct 3 (Visual)




Rewarded Ads are usually full-screen video ads which users can view to receive a reward inside the application, like an additional in-game currency or a health bonus.

Example Usage

System On start of layout
    Enhance Show rewarded ad with placement Enhance.REWARDED_PLACEMENT_NEUTRAL

Enhance On rewarded ad failed
    Browser Alert "Rewarded ad is not ready"

Enhance On reward granted
    System Enhance.LastRewardType = Enhance.REWARD_TYPE_ITEM
        Browser Alert "Reward granted (item)"
    System Else
    System Enhance.LastRewardType = Enhance.REWARD_TYPE_COINS
        Browser Alert "Reward granted (coins)"

Actions

Enhance Show rewarded ad

Display a new rewarded ad if any is currently available. The ad provider is selected based on your app's mediation settings. If this action fails for any reason, the On rewarded ad failed condition will be triggered.

Parameters:
optional placement - Specifies the placement of the ad (describes in what moment the ad is shown). The default value is Enhance.REWARDED_PLACEMENT_NEUTRAL.

Conditions

Enhance On rewarded ad failed

Triggered when Enhance failed to show the ad (e.g. received no fill error from the ad network).

Enhance On reward granted

Triggered when a reward is granted to the user. To fetch more information about the reward, use the Enhance.LastRewardType and Enhance.LastRewardValue expressions.

Enhance On reward declined

Triggered when a reward is declined by the user.

Enhance On reward unavailable

Triggered when a reward is unavailable.

Expressions

string Enhance.LastRewardType

Type of the latest granted reward.

number Enhance.LastRewardValue

Value of the latest granted reward. Only applicable if Enhance.LastRewardType is Enhance.REWARD_TYPE_COINS.

string Enhance.REWARD_TYPE_ITEM

The granted reward is a game-defined item.

string Enhance.REWARD_TYPE_COINS

The granted reward is a specified number of coins.

string Enhance.REWARDED_PLACEMENT_SUCCESS

The ad is following a success in the game, such as completing a level.

string Enhance.REWARDED_PLACEMENT_HELPER

The ad is shown to help the user, for instance after losing a level.

string Enhance.REWARDED_PLACEMENT_NEUTRAL

The ad is shown in a neutral moment.

Rewarded Video: Xamarin (C#)




Rewarded Ads are usually full-screen video ads which users can view to receive a reward inside the application, like an additional in-game currency or a health bonus.

Example Usage

// Callbacks:

private void OnRewardGranted(Enhance.RewardType rewardType, int rewardValue) {
    if (rewardType == Enhance.RewardType.Item) {
        writeLog ("Reward granted (item)");
    } else if (rewardType == Enhance.RewardType.Coins) {
        writeLog ("Reward granted (coins)");
        writeLog ("Reward value: " + rewardValue);
    }
}

private void OnRewardDeclined() {
    writeLog ("Reward declined");
}

private void OnRewardUnavailable() {
    writeLog ("Reward unavailable");
}

if (Enhance.IsRewardedAdReady()) {
    // The ad is ready, show it
    Enhance.ShowRewardedAd (OnRewardGranted, OnRewardDeclined, OnRewardUnavailable);
}

Methods

bool Enhance.IsRewardedAdReady( string placement = Enhance.REWARDED_PLACEMENT_NEUTRAL )

Check if a rewarded ad from any of the included SDK providers is ready to be shown.

Parameters:
optional string placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Returns:
Returns true if any ad is ready, false otherwise.

void Enhance.ShowRewardedAd( string placement = Enhance.REWARDED_PLACEMENT_NEUTRAL, Action<RewardType, int> onRewardGrantedCallback, Action onRewardDeclinedCallback, Action onRewardUnavailableCallback )

Display a new rewarded ad if any is currently available. The ad provider is selected based on your app's mediation settings.

Parameters:
optional string placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Action<RewardType, int> onRewardGrantedCallback - Specifies the action which is triggered when a new reward is granted to the user. As parameters, this action will receive the reward type and value (only applicable if the reward type is Enhance.RewardType.Coins).

Action onRewardDeclinedCallback - Specifies the action which is triggered when a reward is declined by the user, for example: he closed the ad before its end.

Action onRewardUnavailableCallback - Specifies the action which is triggered when a reward is unavailable, because of the ad network error for example.

Members

string Enhance.REWARDED_PLACEMENT_SUCCESS

The ad is following a success in the game, such as completing a level.

string Enhance.REWARDED_PLACEMENT_HELPER

The ad is shown to help the user, for instance after losing a level.

string Enhance.REWARDED_PLACEMENT_NEUTRAL

The ad is shown in a neutral moment.

enum Enhance.RewardType.Item

The granted reward is a game-defined item.

enum Enhance.RewardType.Coins

The granted reward is a specified number of coins.

Rewarded Video: MIT App Inventor (Visual)




Rewarded Ads are usually full-screen video ads which users can view to receive a reward inside the application, like an additional in-game currency or a health bonus.

Example Usage

when Button.Click
do
    if      call EnhanceConnector1.IsRewardedAdReady
    then    call EnhanceConnector1.ShowRewardedAd
    else    call Notifier1.ShowAlert
                 notice = "Rewarded ad is not ready"

when EnhanceConnector1.RewardGranted
do
    call Notifier1.ShowAlert
         notice = "Reward granted!"
    call Notifier1.ShowAlert
         notice = get rewardType                 

when EnhanceConnector1.RewardDeclined
do
    call Notifier1.ShowAlert
         notice = "Reward declined"

when EnhanceConnector1.RewardUnavailable
do
    call Notifier1.ShowAlert
         notice = "Reward unavailable"

Methods

boolean IsRewardedAdReady

Check if a rewarded ad from any of the included SDK providers is ready to be shown.

Returns:
Returns true if any ad is ready, false otherwise.

boolean IsRewardedAdReadyForPlacement

Check if a rewarded ad from any of the included SDK providers is ready to be shown.

Parameters:
text placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Returns:
Returns true if any ad is ready, false otherwise.

void ShowRewardedAd

Display a new rewarded ad if any is currently available. The ad provider is selected based on your app's mediation settings.

void ShowRewardedAdWithPlacement

Display a new rewarded ad if any is currently available. The ad provider is selected based on your app's mediation settings.

Parameters:
text placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Events

RewardGranted

Triggered when a reward is granted to the user. To fetch more information about the reward, use the attached rewardType and rewardValue variables. The rewardType will be either "item", "coins" or "unknown".

RewardDeclined

Triggered when a reward is declined by the user.

RewardUnavailable

Triggered when a reward is unavailable.