Package com.inmobi.ads

## Class InMobiInterstitial

- All Implemented Interfaces:

      public final class InMobiInterstitial

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `private final PreloadManager` | `preloadManager` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `InMobiInterstitial(Context context, Long placementId, InterstitialAdEventListener listener)` |

  - ### Enum Constant Summary

    Enum Constants
    Enum Constant | Description
    --- | ---

  - ### Method Summary

    Modifier and Type | Method | Description
    --- | --- | ---
    `final PreloadManager` | `getPreloadManager()` | Instance of PreloadManager object in order to preload or load a preloaded ad.
    `final Unit` | `setListener(InterstitialAdEventListener listener)` | Set a listener to be notified of lifecycle events for the InMobiInterstitial instance.
    `final Unit` | `setKeywords(String keywords)` | Set comma delimited keywords for targeting purpose
    `final Unit` | `getSignals()` | Called to create the request payload & the value is returned in InterstitialAdEventListener.onRequestPayloadCreated callback on success, and in case of failure InterstitialAdEventListener.onRequestPayloadCreationFailed is invoked.
    `final Unit` | `load(ByteArray response)` | Called to render the ad with the provided response.
    `final Unit` | `load()` | Submit a request to load ad content.
    `final Unit` | `loadAdUnit()` |
    `final Unit` | `show()` | Show the interstitial ad.
    `final Unit` | `show(Context context)` | Show the interstitial ad.
    `final Boolean` | `isReady()` | Returns `true` if the interstitial was loaded successfully and in ready to be shown.
    `final Unit` | `setExtras(Map<String, String> extras)` | Set any additional custom parameters that will be sent in the ad request.
    `final Unit` | `setContentUrl(String contentUrl)` | Set the current context of the app.
    `final Unit` | `setWatermarkData(WatermarkData watermarkData)` | Sets an Ad Identification Overlay on top of the Ad.
    `final Unit` | `disableHardwareAcceleration()` | Disable hardware acceleration on the underlying views.
    `final Unit` | `notifyWin(Double minBidToWin)` | Notify the SDK that the bid for this ad was won.
    `final Unit` | `notifyLoss(Integer lossReason, Double auctionPrice)` | Notify the SDK that the bid for this ad was lost.

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### InMobiInterstitial

          InMobiInterstitial(Context context, Long placementId, InterstitialAdEventListener listener)

      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

  - ### Method Detail

    - #### getPreloadManager

           final PreloadManager getPreloadManager()

      Instance of PreloadManager object in order to preload or load a preloaded ad.

      Returns:

        an instance of PreloadManager

    - #### setListener

           final Unit 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

           final Unit setKeywords(String keywords)

      Set comma delimited keywords for targeting purpose

      Parameters:
        `keywords` - comma delimited keywords for targeting purpose

    - #### getSignals

          @Deprecated(message = "Please use InMobiSdk.getToken() instead.", replaceWith = @ReplaceWith(imports = {"com.inmobi.ads.InMobiSdk"}, expression = "InMobiSdk.getToken()"), level = DeprecationLevel.WARNING) final Unit getSignals()

      Called to create the request payload & the value is returned in InterstitialAdEventListener.onRequestPayloadCreated callback on success, and in case of failure InterstitialAdEventListener.onRequestPayloadCreationFailed is invoked.

    - #### load

           final Unit load(ByteArray 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

          @UiThread() final Unit 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.

    - #### loadAdUnit

           final Unit loadAdUnit()

    - #### show

          @UiThread() final Unit show()

      Show the interstitial ad. Call this method after receiving the 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

          @UiThread() final Unit show(Context context)

      Show the interstitial ad. Call this method after receiving the 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.

      Parameters:
        `context` - Activity Context in which the interstitial has to be shown

    - #### isReady

           final 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

           final Unit setExtras(Map<String, 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

           final Unit setContentUrl(String contentUrl)

      Set the current context of the app.

      Parameters:
        `contentUrl` -

        - Represents the contentUrl of the app

    - #### setWatermarkData

           final Unit setWatermarkData(WatermarkData watermarkData)

      Sets an Ad Identification Overlay on top of the Ad.

      Parameters:
        `watermarkData` -

        - Data for the overlay. Needs a Base64 encoded overlay image String.

    - #### disableHardwareAcceleration

           final Unit disableHardwareAcceleration()

      Disable hardware acceleration on the underlying views.

    - #### notifyWin

           final Unit notifyWin(Double minBidToWin)

      Notify the SDK that the bid for this ad was won. This should be called only once per ad

    - #### notifyLoss

           final Unit notifyLoss(Integer lossReason, Double auctionPrice)

      Notify the SDK that the bid for this ad was lost. This should be called only once per ad

      Parameters:
        `lossReason` - Represents the reason code for losing the auction
        `auctionPrice` - Represents the price of the winning bid