@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, POBBidEvent.POBBidProceedState| Constructor and Description |
|---|
POBInterstitial(android.content.Context context,
java.lang.String publisherId,
int profileId,
java.lang.String adUnitId)
Constructor.
|
POBInterstitial(android.content.Context context,
java.lang.String publisherId,
int profileId,
java.lang.String adUnitId,
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 |
proceedOnError(POBBidEvent.BidEventError error)
Notifies the bid failure with error
Note: Should be called from Main/UI thread
|
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
android.content.Context context,
@NonNull
java.lang.String publisherId,
int profileId,
@NonNull
java.lang.String adUnitId)
context - Activity/Application contextpublisherId - Identifier of the publisherprofileId - Profile ID of an ad tagadUnitId - Ad unit id used to identify unique placement on screenpublic POBInterstitial(@NonNull
android.content.Context context,
@NonNull
java.lang.String publisherId,
int profileId,
@NonNull
java.lang.String adUnitId,
@NonNull
POBInterstitialEvent listener)
context - Activity/Application contextpublisherId - Identifier of the publisherprofileId - Profile ID of an ad tagadUnitId - Ad unit id used to identify unique placement on screenlistener - Valid instance of POBInterstitialEventpublic void loadAd()
@Nullable public POBImpression getImpression()
@Nullable public POBRequest getAdRequest()
public void show()
public boolean isReady()
public void setListener(POBInterstitial.POBInterstitialListener listener)
listener - Instance of POBInterstitialListenerpublic void setVideoListener(POBInterstitial.POBVideoListener listener)
listener - Instance of POBVideoListenerpublic void setBidEventListener(@Nullable
POBBidEventListener bidEventListener)
setBidEventListener in interface POBBidEventbidEventListener - reference of POBBidEventListenerpublic boolean proceedToLoadAd()
POBBidEventPOBBidEventListener 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 POBBidEventpublic void proceedOnError(@NonNull
POBBidEvent.BidEventError error)
POBBidEventproceedOnError in interface POBBidEventerror - 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);
@Nullable public POBBid getBid()
getBid in interface POBBidEventpublic void destroy()