콘솔로 이동

RewardedAdCallback

public abstract class RewardedAdCallback extends Object

A listener for receiving notifications during the lifecycle of a rewarded ad.

Constant Summary

int ERROR_CODE_AD_REUSED The rewarded ad has already been shown.
int ERROR_CODE_APP_NOT_FOREGROUND The rewarded ad can not be shown when app is not in foreground.
int ERROR_CODE_INTERNAL_ERROR Something happened internally.
int ERROR_CODE_NOT_READY The rewarded ad is not ready.

Public Constructor Summary

Public Method Summary

void
onRewardedAdClosed()
Called when a rewarded ad is closed.
void
onRewardedAdFailedToShow(int errorCode)
Called when a rewarded ad failed to show.
void
onRewardedAdOpened()
Called when a rewarded ad opens a overlay that covers the screen.
abstract void
onUserEarnedReward(RewardItem reward)
Called when a rewarded ad triggers a reward.

Inherited Method Summary

Constants

public static final int ERROR_CODE_AD_REUSED

The rewarded ad has already been shown.

Constant Value: 1

public static final int ERROR_CODE_APP_NOT_FOREGROUND

The rewarded ad can not be shown when app is not in foreground.

Constant Value: 3

public static final int ERROR_CODE_INTERNAL_ERROR

Something happened internally.

Constant Value: 0

public static final int ERROR_CODE_NOT_READY

The rewarded ad is not ready.

Constant Value: 2

Public Constructors

public RewardedAdCallback ()

Public Methods

public void onRewardedAdClosed ()

Called when a rewarded ad is closed.

public void onRewardedAdFailedToShow (int errorCode)

Called when a rewarded ad failed to show. The error code is usually ERROR_CODE_INTERNAL_ERROR, ERROR_CODE_AD_REUSED, {ERROR_CODE_NOT_READY.

public void onRewardedAdOpened ()

Called when a rewarded ad opens a overlay that covers the screen.

public abstract void onUserEarnedReward (RewardItem reward)

Called when a rewarded ad triggers a reward. The app is responsible for crediting the user with the reward.

Parameters
reward the reward to grant the user. This value will never be null. If the ad does not specify a reward amount and no override is provided for this ad unit on the Admob UI, the default reward (DEFAULT_REWARD) will have an amount of 1 and a type of "".