Home





Rewarded Ads

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

-(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

Enhance isRewardedAdReady

BOOL [Enhance isRewardedAdReady]

Check if an ad from any of the included SDK providers is ready to be shown. Return Value:

Returns true if any ad is ready, false otherwise. When app is not Enhanced, always returns true.

Enhance isRewardedAdReady

BOOL [Enhance isRewardedAdReady:
    (NSString*) placement
]

Check if an ad from any of the included SDK providers is ready to be shown. Parameters:

NSString* placement - Specifies the internal placement of the ad (from the Enhance mediation editor).

Return Value:

Returns true if any ad is ready, false otherwise. When app is not Enhanced, always returns true.

Enhance showRewardedAd

void [Enhance showRewardedAd:
    (id) delegate
]

Display an ad if any is currently available. The ad provider is selected based on your app's mediation settings. Parameters:

id delegate - Specifies the callback object which is triggered when a reward is granted, declined or unavailable. Should implement the RewardDelegate protocol. (See the Interfaces section for more information)

Enhance showRewardedAd

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

Display an ad if any is currently available. The ad provider is selected based on your app's mediation settings. Parameters:

id delegate - Specifies the callback object which is triggered when a reward is granted, declined or unavailable. (For more information about the RewardCallback type, see the Interfaces section).

NSString* placement - Specifies the internal placement of the ad (from the Enhance mediation editor).


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


NSString* PLACEMENT_DEFAULT

The default internal placement of all ad types. Always equal to "default".


RewardType REWARDTYPE_ITEM

Indicates that the granted reward is a game-defined item.


RewardType REWARDTYPE_COINS

Indicates that the granted reward is a specific number of coins.