MoPubInterstitial

public class MoPubInterstitial

The object representing a MoPub interstitial ad, and associated methods.

Public Methods

public void /destroy()

  • Description: Removes existing interstitial instance in session. Used when finished showing an ad to free up existing resources.

  • Parameters: None.

public void /forceRefresh()

  • Description: Manually sends out a new ad request that is initiated by the publisher. Used to issue a new ad request and start a new refresh cycle.

  • Parameters: None.

public MoPubInterstitial.InterstitialAdListener /getInterstitialAdListener()

  • Description: Returns InterstitialAdListener, the ad listener associated with the current interstitial ad object.

  • Parameters: None.

public String /getKeywords()

  • Description: Returns any non-user-identifiable keywords that have been set on the current banner object. Null if no keywords have been set.

  • Parameters: None.

public Map<String, Object> /getLocalExtras()

  • Description: Returns a map of key-value pairs that have been set on the current interstitial object to be used later. Null if no local extras are set.

  • Parameters: None.

public Location /getLocation()

  • Description: Returns a Location object that has been set on the current interstitial object. Null if no location has been set.

  • Parameters: None.

public String /getUserDataKeywords()

  • Description: Returns any user-identifiable keywords that have been set on the current banner object. Null if no keywords have been set.

  • Parameters: None.

public boolean /isReady()

  • Description: Returns true if the interstitial has been successfully cached and is ready to be shown; false otherwise.

  • Parameters: None.

public void /load()

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

public void /setInterstitialAdListener(MoPubInterstitial.InterstitialAdListener listener)

  • Description: Registers a listener for the current ad object to be informed of the ad’s lifecycle events.

  • Parameters:

    • listener: An object contains listeners corresponding to the interstitial’s lifecycle events.

public void /setKeywords(String keywords)

  • Description: Optionally used to specify non-user-identifiable keywords on the current banner object to pass in the ad request for ad targeting.

  • Parameters:

    • keywords: A String containing data to be passed to the current banner ad object.

public void /setLocalExtras(Map<String, Object> extras)

  • Description: Specifies a map of key-value pairs on the current interstitial object to be passed in the ad request for ad targeting. Used to append additional data for mediation.

  • Parameters:

    • extras: A Map containing key-value pairs to be passed.

public void /setUserDataKeywords(String userDataKeywords)

  • Description: In GDPR-applicable cases, specifies user-identifiable keywords on the current interstitial object to be passed in the ad request for targeting.

  • Parameters:

    • userDataKeywords: A String containing user-identifiable data to be passed to the current interstitial ad object.

public boolean /show()

  • Description: Attempts to display an interstitial ad if it is ready. (To confirm that an ad is cached, isReady() can be called.) Returns true if the ad is ready; false otherwise.

  • Parameters: None.

Last updated March 03, 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.)