CustomEventNative

public abstract class CustomEventNative

A base class for custom events that support native ads. Implementing a subclass of CustomEventNative() enables the MoPub SDK to support native ad mediation with other ad networks.

Public Methods

public protected abstract void /loadNativeAd(Context context, CustomEventNativeListener customEventNativeListener, Map<String,Object> localExtras, Map<String,String> serverExtras)

  • Description: Issues an ad request. Should only be called after initializing the SDK with initializeSdk().

  • Parameters:

    • context: The current context.
    • customEventNativeListener: An Object that must be notified of certain lifecycle events.
    • localExtras: A Map containing additional custom data that is set within your application by calling MoPubNative.setLocalExtras(Map). Note that the localExtras Map is a copy of the Map supplied to MoPubNative.setLocalExtras(Map).
    • serverExtras: A Map containing additional custom data configurable on the MoPub website to associate with a given custom event request. This data may be used to pass dynamic information, such as publisher IDs, without changes in application code.

public protected void /onInvalidate()

  • Description: Destroys the current native object and unregisters any hanging references.

  • Parameters: None.

Last updated March 04, 2020

TWITTER, MOPUB, and the Bird logo are trademarks of Twitter, Inc. or its affiliates. All third party logos and trademarks included are the property of their respective owners.

© 2020 MoPub (a division of Twitter, Inc.)