Class InMobiInterstitial


  • public final class InMobiInterstitial
    extends java.lang.Object
    Use this class to integrate full screen, interstitial ads in your application.

    Note This class is not thread-safe. All methods on instances of this class must be called on the UI thread.

    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void disableHardwareAcceleration()
      Disable hardware acceleration on the underlying views.
      org.json.JSONObject getAdMetaInfo()
      Deprecated.
      java.lang.String getCreativeId()
      Deprecated.
      PreloadManager getPreloadManager()
      Method to get the PreloadManager object in order to preload or load a preloaded ad.
      void getSignals()
      Called to create the request payload & the value is returned in AdEventListener.onRequestPayloadCreated(byte[]) callback on success, and in case of failure AdEventListener.onRequestPayloadCreationFailed(InMobiAdRequestStatus) is invoked.
      boolean isReady()
      Returns true if the interstitial was loaded successfully and in ready to be shown.
      void load()
      Submit a request to load ad content.
      void load​(byte[] response)
      Called to render the ad with the provided response.
      void setContentUrl​(java.lang.String contentUrl)
      Set the current context of the app.
      void setExtras​(java.util.Map<java.lang.String,​java.lang.String> extras)
      Set any additional custom parameters that will be sent in the ad request.
      void setKeywords​(java.lang.String keywords)
      Set comma delimited keywords for targeting purpose
      void setListener​(InterstitialAdEventListener listener)
      Set a listener to be notified of lifecycle events for the InMobiInterstitial instance.
      void show()
      Show the interstitial ad.
      void show​(int enterAnimationResourcedId, int exitAnimationResourceId)
      Deprecated.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InMobiInterstitial

        public InMobiInterstitial​(android.content.Context context,
                                  long placementId,
                                  InterstitialAdEventListener listener)
                           throws SdkNotInitializedException
        Parameters:
        context - Represents the context where the interstitial is going to be shown
        placementId - Represents the placement-ID of the interstitial ad
        listener - Represents the listener to get callbacks for the lifecycle of the ad
        Throws:
        SdkNotInitializedException - If the IM-SDK was not initialized before creating ad object
    • Method Detail

      • setListener

        public void setListener​(InterstitialAdEventListener listener)
        Set a listener to be notified of lifecycle events for the InMobiInterstitial instance.
        Parameters:
        listener - Represents the listener to provide callbacks
      • setKeywords

        public void setKeywords​(java.lang.String keywords)
        Set comma delimited keywords for targeting purpose
        Parameters:
        keywords - comma delimited keywords for targeting purpose
      • getSignals

        public void getSignals()
        Called to create the request payload & the value is returned in AdEventListener.onRequestPayloadCreated(byte[]) callback on success, and in case of failure AdEventListener.onRequestPayloadCreationFailed(InMobiAdRequestStatus) is invoked.
      • load

        public void load​(byte[] response)
        Called to render the ad with the provided response. Once the SDK starts loading the provided response, it will start giving callbacks through InterstitialAdEventListener listener.
        Parameters:
        response - Represents the response to be used to render an ad
      • load

        public void load()
        Submit a request to load ad content. This method returns immediately upon enqueuing a request. Your application shall be notified of the result on the InterstitialAdEventListener callback.

        Note This method must be called on the UI thread. Failure to do so will affect your ability to monetize with the InMobi Ad SDK.

      • show

        public void show()
        Show the interstitial ad. Call this method after receiving the callback InterstitialAdEventListener#onAdLoadSucceeded(InMobiInterstitial)

        Note This method must be called on the UI thread. Failure to do so will affect your ability to monetize with the InMobi Ad SDK.

      • show

        @Deprecated
        public void show​(int enterAnimationResourcedId,
                         int exitAnimationResourceId)
        Deprecated.
        Show the interstitial ad. This method allows your application to set the transition animation when the ad is shown to the user. If an invalid value of enter or exit animation id is provided the default animations of the platform will be used. In order to disable enter/exit animations please pass 0 as the animation id.

        Note This method must be called on the UI thread. Failure to do so will affect your ability to monetize with the InMobi Ad SDK.

        Parameters:
        enterAnimationResourcedId -
        exitAnimationResourceId -
      • isReady

        public boolean isReady()
        Returns true if the interstitial was loaded successfully and in ready to be shown.
        Returns:
        true if the interstitial was loaded successfully and in ready to be shown.
      • setExtras

        public void setExtras​(java.util.Map<java.lang.String,​java.lang.String> extras)
        Set any additional custom parameters that will be sent in the ad request.
        Parameters:
        extras - Additional custom parameters that will be sent in the ad request.
      • setContentUrl

        public void setContentUrl​(java.lang.String contentUrl)
        Set the current context of the app.
        Parameters:
        contentUrl - - Represents the contentUrl of the app
      • disableHardwareAcceleration

        public void disableHardwareAcceleration()
        Disable hardware acceleration on the underlying views.