Class InMobiInterstitial
-
- All Implemented Interfaces:
public final class InMobiInterstitial
-
-
Field Summary
Fields Modifier and Type Field Description private final PreloadManagerpreloadManager
-
Constructor Summary
Constructors Constructor Description InMobiInterstitial(Context context, Long placementId, InterstitialAdEventListener listener)
-
Method Summary
Modifier and Type Method Description final PreloadManagergetPreloadManager()Instance of PreloadManager object in order to preload or load a preloaded ad. final UnitsetListener(InterstitialAdEventListener listener)Set a listener to be notified of lifecycle events for the InMobiInterstitial instance. final UnitsetKeywords(String keywords)Set comma delimited keywords for targeting purpose final UnitgetSignals()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 Unitload(ByteArray response)Called to render the ad with the provided response. final Unitload()Submit a request to load ad content. final UnitloadAdUnit()final Unitshow()Show the interstitial ad. final Unitshow(Context context)Show the interstitial ad. final BooleanisReady()Returns trueif the interstitial was loaded successfully and in ready to be shown.final UnitsetExtras(Map<String, String> extras)Set any additional custom parameters that will be sent in the ad request. final UnitsetContentUrl(String contentUrl)Set the current context of the app. final UnitsetWatermarkData(WatermarkData watermarkData)Sets an Ad Identification Overlay on top of the Ad. final UnitdisableHardwareAcceleration()Disable hardware acceleration on the underlying views. final UnitnotifyWin(Double minBidToWin)Notify the SDK that the bid for this ad was won. final UnitnotifyLoss(Integer lossReason, Double auctionPrice)Notify the SDK that the bid for this ad was lost. -
-
Constructor Detail
-
InMobiInterstitial
InMobiInterstitial(Context context, Long placementId, InterstitialAdEventListener listener)
- Parameters:
context- Represents the context where the interstitial is going to be shownplacementId- Represents the placement-ID of the interstitial adlistener- 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
trueif the interstitial was loaded successfully and in ready to be shown.- Returns:
trueif 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 auctionauctionPrice- Represents the price of the winning bid
-
-
-
-