This interface is deprecated.
Use Adapter
instead.
A custom event to support native ads.
The typical life-cycle for a custom event is to have
requestNativeAd(Context, CustomEventNativeListener, String, NativeMediationAdRequest,
Bundle)
called once. At this point the adapter should create a native ad and
report to the
CustomEventNativeListener
either
CustomEventNativeListener.onAdLoaded(UnifiedNativeAdMapper)
or
CustomEventListener.onAdFailedToLoad(AdError)
.
At the end of the life cycle, a best effort is made to call
CustomEvent.onDestroy()
, though this is not guaranteed. Note that
requestNativeAd(Context, CustomEventNativeListener, String, NativeMediationAdRequest,
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
CustomEventNativeListener
passed in the
requestNativeAd(Context, CustomEventNativeListener, String, NativeMediationAdRequest,
Bundle)
call. All parameters necessary to make an ad request should be passed in
the serverParameter
, NativeMediationAdRequest
,
and customEventExtras
parameters.
Public Method Summary
abstract void |
requestNativeAd(Context
context,
CustomEventNativeListener listener, String
serverParameter,
NativeMediationAdRequest mediationAdRequest, Bundle
customEventExtras)
Called by the mediation library to request a native ad from the custom event.
|
Inherited Method Summary
Public Methods
public abstract void requestNativeAd (Context context, CustomEventNativeListener listener, String serverParameter, NativeMediationAdRequest mediationAdRequest, Bundle customEventExtras)
Called by the mediation library to request a native ad from the custom event.
If the request is successful,
CustomEventNativeListener.onAdLoaded(UnifiedNativeAdMapper)
should be
called.
If the request is unsuccessful,
CustomEventListener.onAdFailedToLoad(AdError)
should be called on the
listener
with an appropriate error cause.
This method is called on the UI thread so all the standard precautions of writing code on that thread apply. In particular your code should not call any blocking methods.
Parameters
context | The Context
which will contain the custom event. |
---|---|
listener | Listener to custom event with callbacks for various events. |
serverParameter | The string configured in the publisher UI as the parameter for the custom event. |
mediationAdRequest | Generic targeting parameters to use when requesting a view. |
customEventExtras | A Bundle of
parameters set by the publisher on a per-request basis. |