Class MagniteInterstitialAd

java.lang.Object
com.magnite.sdk.adsbase.Ad
com.magnite.sdk.adsbase.MagniteInterstitialAd
All Implemented Interfaces:
com.magnite.sdk.adsbase.DeveloperInterface
Direct Known Subclasses:
MagniteRewardedAd

public class MagniteInterstitialAd extends com.magnite.sdk.adsbase.Ad implements com.magnite.sdk.adsbase.DeveloperInterface
Represents an Interstitial Ad - a full screen ad which may be displayed during a natural transition points such as a screen change, after the game over screen, before loading the next game level, etc.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Represents different kinds of ad content

    Nested classes/interfaces inherited from class com.magnite.sdk.adsbase.Ad

    com.magnite.sdk.adsbase.Ad.AdState, com.magnite.sdk.adsbase.Ad.AdType
  • Field Summary

    Fields inherited from class com.magnite.sdk.adsbase.Ad

    activityExtra, adCacheManager, adCacheTtl, belowMinCPM, consentData, consentManager, context, errorMessage, eventTracer, extraData, httpClient, networkApiExecutor, placement, videoAdCacheManager, webViewCacheLoader, webViewFactory
  • Constructor Summary

    Constructors
    Constructor
    Description
    MagniteInterstitialAd(android.content.Context context)
    It is recommended to keep an instance in memory as a Singleton object, and then reuse it multiple times to load and show ads.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Deprecated.
    static void
    enableConsent(android.content.Context context, boolean enabled)
    Deprecated.
    static void
    init(android.content.Context context, String devId, String appId)
    Deprecated.
    boolean
    Deprecated.
    void
    load(com.magnite.sdk.adsbase.model.AdPreferences adPreferences, AdEventListener callback)
    Deprecated.
    void
    load(com.magnite.sdk.adsbase.model.AdPreferences adPreferences, AdEventListener callback, String adm)
    Deprecated.
    void
    Alias for loadAd(AdMode.AUTOMATIC, new AdPreferences(), null);
    void
    Alias for loadAd(AdMode.AUTOMATIC, new AdPreferences(), listener, null);
    void
    loadAd(AdEventListener listener, String adm)
    Alias for loadAd(AdMode.AUTOMATIC, new AdPreferences(), listener, adm);
    void
    Alias for loadAd(adMode, new AdPreferences(), null);
    void
    Alias for loadAd(adMode, new AdPreferences(), listener);
    void
    loadAd(MagniteInterstitialAd.AdMode adMode, com.magnite.sdk.adsbase.model.AdPreferences adPreferences)
    Alias for loadAd(adMode, adPreferences, null);
    void
    loadAd(MagniteInterstitialAd.AdMode adMode, com.magnite.sdk.adsbase.model.AdPreferences adPreferences, AdEventListener listener, String adm)
    Loads ad according to the adMode and adPreferences given.
    void
    loadAd(com.magnite.sdk.adsbase.model.AdPreferences adPreferences)
    Alias for loadAd(AdMode.AUTOMATIC, adPreferences, null);
    void
    loadAd(com.magnite.sdk.adsbase.model.AdPreferences adPreferences, AdEventListener listener)
    Alias for loadAd(AdMode.AUTOMATIC, adPreferences, listener, adm);
    boolean
    Shows an ad, if it has been loaded.
    boolean
    Shows an ad, if it has been loaded.
    boolean
    showAd(String adTag)
    Deprecated.
    boolean
    showAd(String adTag, AdDisplayListener listener)
    Deprecated.

    Methods inherited from class com.magnite.sdk.adsbase.Ad

    canShowAd, createService, getAdCacheTtl, getAdId, getAdInfoOverride, getBidToken, getConsentData, getContext, getDParam, getErid, getEridUrl, getErrorMessage, getExtraData, getFallbackAdCacheTtl, getLastLoadTime, getNotDisplayedReason, getPlacement, getRequestUrl, getState, getType, getVideoCancelCallBack, hasAdCacheTtlPassed, isBelowMinCPM, isTiedToAdm, load, load, load, loadAds, resolveActivityToShowAd, setActivityExtra, setAdInfoOverride, setContext, setErid, setEridUrl, setErrorMessage, setExtraData, setNotDisplayedReason, setRequestUrl, setState, setVideoCancelCallBack

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.magnite.sdk.adsbase.DeveloperInterface

    close, loadAd, loadAd, onBackPressed, onPause, onRestoreInstanceState, onResume, onSaveInstanceState
  • Constructor Details

    • MagniteInterstitialAd

      public MagniteInterstitialAd(@NonNull android.content.Context context)
      It is recommended to keep an instance in memory as a Singleton object, and then reuse it multiple times to load and show ads. In other words, an instance should not be linked to the Activity lifecycle, and it should survive the Activity recreation.
      Parameters:
      context - Application context
  • Method Details

    • init

      @Deprecated public static void init(android.content.Context context, String devId, String appId)
      Deprecated.
      This method will be removed in version 4.12.0
      See Also:
    • load

      @Deprecated public void load(@Nullable com.magnite.sdk.adsbase.model.AdPreferences adPreferences, @Nullable AdEventListener callback)
      Deprecated.
      Overrides:
      load in class com.magnite.sdk.adsbase.Ad
    • load

      @Deprecated public void load(@Nullable com.magnite.sdk.adsbase.model.AdPreferences adPreferences, @Nullable AdEventListener callback, @Nullable String adm)
      Deprecated.
      Overrides:
      load in class com.magnite.sdk.adsbase.Ad
      See Also:
    • loadAd

      public void loadAd()
      Alias for loadAd(AdMode.AUTOMATIC, new AdPreferences(), null);
      Specified by:
      loadAd in interface com.magnite.sdk.adsbase.DeveloperInterface
      See Also:
      • DeveloperInterface.loadAd(AdMode, AdPreferences, AdEventListener)
    • loadAd

      public void loadAd(@NonNull com.magnite.sdk.adsbase.model.AdPreferences adPreferences)
      Alias for loadAd(AdMode.AUTOMATIC, adPreferences, null);
      Specified by:
      loadAd in interface com.magnite.sdk.adsbase.DeveloperInterface
      See Also:
      • DeveloperInterface.loadAd(AdMode, AdPreferences, AdEventListener)
    • loadAd

      public void loadAd(@NonNull AdEventListener listener)
      Alias for loadAd(AdMode.AUTOMATIC, new AdPreferences(), listener, null);
      Specified by:
      loadAd in interface com.magnite.sdk.adsbase.DeveloperInterface
      See Also:
      • DeveloperInterface.loadAd(AdMode, AdPreferences, AdEventListener)
    • loadAd

      public void loadAd(@NonNull AdEventListener listener, @Nullable String adm)
      Alias for loadAd(AdMode.AUTOMATIC, new AdPreferences(), listener, adm);
      Specified by:
      loadAd in interface com.magnite.sdk.adsbase.DeveloperInterface
      See Also:
      • DeveloperInterface.loadAd(AdMode, AdPreferences, AdEventListener)
    • loadAd

      public void loadAd(@NonNull com.magnite.sdk.adsbase.model.AdPreferences adPreferences, @NonNull AdEventListener listener)
      Alias for loadAd(AdMode.AUTOMATIC, adPreferences, listener, adm);
      Specified by:
      loadAd in interface com.magnite.sdk.adsbase.DeveloperInterface
      See Also:
      • DeveloperInterface.loadAd(AdMode, AdPreferences, AdEventListener)
    • loadAd

      public void loadAd(@NonNull MagniteInterstitialAd.AdMode adMode)
      Alias for loadAd(adMode, new AdPreferences(), null);
      Specified by:
      loadAd in interface com.magnite.sdk.adsbase.DeveloperInterface
      See Also:
      • DeveloperInterface.loadAd(AdMode, AdPreferences, AdEventListener)
    • loadAd

      public void loadAd(@NonNull MagniteInterstitialAd.AdMode adMode, @NonNull com.magnite.sdk.adsbase.model.AdPreferences adPreferences)
      Alias for loadAd(adMode, adPreferences, null);
      Specified by:
      loadAd in interface com.magnite.sdk.adsbase.DeveloperInterface
      See Also:
      • DeveloperInterface.loadAd(AdMode, AdPreferences, AdEventListener)
    • loadAd

      public void loadAd(@NonNull MagniteInterstitialAd.AdMode adMode, @NonNull AdEventListener listener)
      Alias for loadAd(adMode, new AdPreferences(), listener);
      Specified by:
      loadAd in interface com.magnite.sdk.adsbase.DeveloperInterface
      See Also:
      • DeveloperInterface.loadAd(AdMode, AdPreferences, AdEventListener)
    • loadAd

      public void loadAd(@NonNull MagniteInterstitialAd.AdMode adMode, @Nullable com.magnite.sdk.adsbase.model.AdPreferences adPreferences, @Nullable AdEventListener listener, @Nullable String adm)
      Loads ad according to the adMode and adPreferences given.
      Specified by:
      loadAd in interface com.magnite.sdk.adsbase.DeveloperInterface
      Parameters:
      adMode - one of MagniteInterstitialAd.AdMode.AUTOMATIC, MagniteInterstitialAd.AdMode.FULLPAGE, MagniteInterstitialAd.AdMode.VIDEO or MagniteInterstitialAd.AdMode.REWARDED_VIDEO for the Rewarded Video Ad
      adPreferences - ad preferences
      listener - a callback to be invoked when ad finishes loading
    • showAd

      public boolean showAd()
      Shows an ad, if it has been loaded.
      Specified by:
      showAd in interface com.magnite.sdk.adsbase.DeveloperInterface
      Returns:
      true if the ad has been shown
    • showAd

      @Deprecated public boolean showAd(String adTag)
      Deprecated.
      This method will be removed in version 4.12.0

      The adTag value must be set into AdPreferences and passed into DeveloperInterface.loadAd(AdMode, AdPreferences, AdEventListener)

      Specified by:
      showAd in interface com.magnite.sdk.adsbase.DeveloperInterface
      Parameters:
      adTag - adTag
      Returns:
      true if the ad has been shown
      See Also:
      • AdPreferences.setAdTag(String)
    • showAd

      public boolean showAd(@Nullable AdDisplayListener listener)
      Shows an ad, if it has been loaded.
      Specified by:
      showAd in interface com.magnite.sdk.adsbase.DeveloperInterface
      Parameters:
      listener - callback to be invoked when an ad events occurred
      Returns:
      true if ad has shown
    • showAd

      @Deprecated public boolean showAd(@Deprecated String adTag, AdDisplayListener listener)
      Deprecated.
      This method will be removed in version 4.12.0

      The adTag value must be set into AdPreferences and passed into DeveloperInterface.loadAd(AdMode, AdPreferences, AdEventListener)

      Specified by:
      showAd in interface com.magnite.sdk.adsbase.DeveloperInterface
      Parameters:
      adTag - adTag
      Returns:
      true if the ad has been shown
      See Also:
      • AdPreferences.setAdTag(String)
    • isReady

      @Deprecated public boolean isReady()
      Deprecated.
      This method is deprecated.

      Instead use AdEventListener in order to receive an event when the ad has been loaded.

      Overrides:
      isReady in class com.magnite.sdk.adsbase.Ad
      Returns:
      true if the ad has been loaded.
    • enableConsent

      @Deprecated public static void enableConsent(@NonNull android.content.Context context, boolean enabled)
      Deprecated.
      This method will be removed from future release of SDK 6.0.0
      See Also:
    • disableSplash

      @Deprecated public static void disableSplash()
      Deprecated.
      This method does nothing and it will be removed completely from future release of SDK 6.0.0