@MainThread public class POBInterstitial extends java.lang.Object implements POBBidEvent
Modifier and Type | Class and Description |
---|---|
static class |
POBInterstitial.POBInterstitialListener
Static member class for interaction with the POBInterstitial instance.
|
static class |
POBInterstitial.POBVideoListener
Static member class for interaction with the POBInterstitial instance for video events.
|
POBBidEvent.BidEventError
Constructor and Description |
---|
POBInterstitial(Context context)
Constructor.
|
POBInterstitial(Context context,
java.lang.String publisherId,
int profileId,
java.lang.String adUnitId)
Constructor.
|
POBInterstitial(Context context,
java.lang.String publisherId,
int profileId,
java.lang.String adUnitId,
com.pubmatic.sdk.openwrap.interstitial.POBInterstitialEvent listener)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Invoke this method when your activity/fragment is about to destroy.
|
POBRequest |
getAdRequest()
Returns an instance of POBRequest, required for setting targeting parameters.
|
POBBid |
getBid()
Get bid
|
POBImpression |
getImpression()
Returns an instance of POBImpression which gets created internally.
|
boolean |
isReady()
Method to check whether the ad is loaded and ready to show InterstitialAd.
|
void |
loadAd()
Initiate the loading of an interstitial ad
|
void |
loadAd(java.lang.String bidResponse)
Initiates the loading of a interstitial ad with oRTB bid response.
|
void |
proceedOnError(POBBidEvent.BidEventError error,
java.lang.String errorMessage)
Introduced in OpenWrapSDK v3.6.0
|
boolean |
proceedToLoadAd()
Proceeds with bid flow, This method should be called only when
POBBidEventListener is set
Note: Should be called from Main/UI thread. |
void |
setBidEventListener(POBBidEventListener bidEventListener)
Sets the BidEventListener for the ad view
Note: Proper reference management practices should be observed when using this listener
|
void |
setListener(POBInterstitial.POBInterstitialListener listener)
Sets instance of POBInterstitialListener for getting callbacks
|
void |
setVideoListener(POBInterstitial.POBVideoListener listener)
Sets instance of POBVideoListener for getting callbacks of VAST based video ad
|
void |
show()
Presents an interstitial ad in full screen view until the user dismisses it.
|
public POBInterstitial(@NonNull Context context, @NonNull java.lang.String publisherId, int profileId, @NonNull java.lang.String adUnitId)
context
- Activity contextpublisherId
- Identifier of the publisherprofileId
- Profile ID of an ad tagadUnitId
- Ad unit id used to identify unique placement on screenpublic POBInterstitial(@NonNull Context context)
context
- Activity contextpublic POBInterstitial(@NonNull Context context, @NonNull java.lang.String publisherId, int profileId, @NonNull java.lang.String adUnitId, @NonNull com.pubmatic.sdk.openwrap.interstitial.POBInterstitialEvent listener)
context
- Activity contextpublisherId
- Identifier of the publisherprofileId
- Profile ID of an ad tagadUnitId
- Ad unit id used to identify unique placement on screenlistener
- Valid instance of POBInterstitialEvent@RequiresPermission(value="android.permission.INTERNET") public void loadAd()
@RequiresPermission(value="android.permission.INTERNET") public void loadAd(@NonNull java.lang.String bidResponse)
bidResponse
- oRTB response of format - oRTB-2.5@Nullable public POBImpression getImpression()
@Nullable public POBRequest getAdRequest()
public void show()
public boolean isReady()
public void setListener(@Nullable POBInterstitial.POBInterstitialListener listener)
listener
- Instance of POBInterstitialListenerpublic void setVideoListener(@Nullable POBInterstitial.POBVideoListener listener)
listener
- Instance of POBVideoListenerpublic void setBidEventListener(@Nullable POBBidEventListener bidEventListener)
setBidEventListener
in interface POBBidEvent
bidEventListener
- reference of POBBidEventListenerpublic boolean proceedToLoadAd()
POBBidEvent
POBBidEventListener
is set
Note: Should be called from Main/UI thread. Also, unnecessary duplicate call will fail and
appropriate errors will be logged with return value `false`proceedToLoadAd
in interface POBBidEvent
public void proceedOnError(@NonNull POBBidEvent.BidEventError error, @NonNull java.lang.String errorMessage)
POBBidEvent
Proceeds with error, If integration type is of primary ad server case like DFP and MoPub, the execution is continued by invoking ad server call ignoring OpenWrap's bid. In case of No ad server integration, flow is completed by setting its state to default considering error at client side. Note: Should be called from Main/UI thread
proceedOnError
in interface POBBidEvent
error
- the error of type POBBidEvent.BidEventError
Example:
Scenario 1 : When bid is failed in client-side in-app auction loss
proceedOnError(BidEventError#CLIENT_SIDE_AUCTION_LOSS);
Scenario 2 : When bid is expired proceedOnError(BidEventError#BID_EXPIRED);
errorMessage
- custom description for the error
Example:
When the bid is failed in client-side application the publisher
can pass on custom message to identify the issue in logs@Nullable public POBBid getBid()
getBid
in interface POBBidEvent
public void destroy()