com.google.android.gms.ads.reward.mediation.MediationRewardedVideoAdAdapter |
Adapter for third party ad networks that support rewarded video ads.
The typical life-cycle for an adapter is to have initialize(Context, MediationAdRequest, String, MediationRewardedVideoAdListener, Bundle, Bundle)
called once. At this
point the ad network should initialize itself and report to the listener either
onInitializationSucceeded(MediationRewardedVideoAdAdapter)
or
onInitializationFailed(MediationRewardedVideoAdAdapter, int)
. Once the ad network is
initialized, the app will request rewarded video by invoking loadAd(MediationAdRequest, Bundle, Bundle)
. At this point, the
adapter should have a rewarded video ad ready and report to the listener either
onAdLoaded(MediationRewardedVideoAdAdapter)
or
onAdFailedToLoad(MediationRewardedVideoAdAdapter, int)
. At the end of the life
cycle, a best effort is made to call onDestroy()
, though this is not guaranteed. Note that
initialize(Context, MediationAdRequest, String, MediationRewardedVideoAdListener, Bundle, Bundle)
and loadAd(MediationAdRequest, Bundle, Bundle)
is called on the UI thread so all the standard
precautions of writing code on that thread apply. In particular, the code should not call any
blocking methods.
The adapter is expected to expose events via the MediationRewardedVideoAdListener
passed
in the
initialize(Context, MediationAdRequest, String, MediationRewardedVideoAdListener, Bundle, Bundle)
call. All parameters necessary to make an ad request should be passed in
the userId
, serverParameters
, MediationAdRequest
, and
mediationExtras
parameters.
Adapters should make an effort to disable multiple reward for one ad.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns
true if the ad network has been initialized.
| |||||||||||
Shows the rewarded video ad.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Returns true
if the ad network has been initialized.
Shows the rewarded video ad. This can be called any time after a call to
onAdLoaded(MediationRewardedVideoAdAdapter)