Class POBInterstitial
-
- All Implemented Interfaces:
-
com.pubmatic.sdk.openwrap.core.POBBidEvent
@MainThread() public class POBInterstitial implements POBBidEvent
Displays full-screen interstitial ads.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classPOBInterstitial.POBVideoListenerStatic member class for interaction with the POBInterstitial instance for video events. These events will only invoked for VAST based video creative. All methods are guaranteed to occur on the main thread.
public classPOBInterstitial.POBInterstitialListenerStatic member class for interaction with the POBInterstitial instance. All methods are guaranteed to occur on the main thread.
-
Constructor Summary
Constructors Constructor Description POBInterstitial(Context context, String publisherId, int profileId, String adUnitId)Constructor. POBInterstitial(Context context)Constructor. POBInterstitial(Context context, String publisherId, int profileId, String adUnitId, POBInterstitialEvent listener)Constructor.
-
Method Summary
Modifier and Type Method Description voidloadAd()Initiate the loading of an interstitial ad voidloadAd(@NonNull() String bidResponse)Initiates the loading of a interstitial ad with oRTB bid response. POBImpressiongetImpression()Returns an instance of POBImpression which gets created internally. POBRequestgetAdRequest()Returns an instance of POBRequest, required for setting targeting parameters. voidshow()Presents an interstitial ad in full screen view until the user dismisses it. booleanisReady()Method to check whether the ad is loaded and ready to show InterstitialAd. voidsetListener(@Nullable() POBInterstitial.POBInterstitialListener listener)Sets instance of POBInterstitialListener for getting callbacks voidsetVideoListener(@Nullable() POBInterstitial.POBVideoListener listener)Sets instance of POBVideoListener for getting callbacks of VAST based video ad booleanproceedToLoadAd()voidproceedOnError(@NonNull() POBBidEvent.BidEventError error, @NonNull() String errorMessage)POBBidgetBid()Get bid voiddestroy()Invoke this method when your activity/fragment is about to destroy. voidsetBidEventListener(@Nullable() POBBidEventListener bidEventListener)Sets the BidEventListener for the ad view Note: Proper reference management practices should be observed when using this listener -
-
Constructor Detail
-
POBInterstitial
POBInterstitial(Context context, String publisherId, int profileId, String adUnitId)
Constructor.- Parameters:
context- Activity contextpublisherId- Identifier of the publisherprofileId- Profile ID of an ad tagadUnitId- Ad unit id used to identify unique placement on screen
-
POBInterstitial
POBInterstitial(Context context)
Constructor.- Parameters:
context- Activity context
-
POBInterstitial
POBInterstitial(Context context, String publisherId, int profileId, String adUnitId, POBInterstitialEvent listener)
Constructor.- Parameters:
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
-
-
Method Detail
-
loadAd
@RequiresPermission(value = "android.permission.INTERNET") void loadAd()
Initiate the loading of an interstitial ad
-
loadAd
@RequiresPermission(value = "android.permission.INTERNET") void loadAd(@NonNull() String bidResponse)
Initiates the loading of a interstitial ad with oRTB bid response. This API expects the response with oRTB v2.5 specification.
- Parameters:
bidResponse- oRTB response of format - oRTB-2.5
-
getImpression
@Nullable() POBImpression getImpression()
Returns an instance of POBImpression which gets created internally. POBImpression provides the APIs to set PubMatic zone id and other custom parameters.
- Returns:
Returns an instance of POBImpression.
-
getAdRequest
@Nullable() POBRequest getAdRequest()
Returns an instance of POBRequest, required for setting targeting parameters.
- Returns:
Instance of POBRequest
-
show
void show()
Presents an interstitial ad in full screen view until the user dismisses it. Calling this method has no effect until the ad is received i.e. onAdReceived() gets called. Recommended to check if isReady() returns true before calling show().
-
isReady
boolean isReady()
Method to check whether the ad is loaded and ready to show InterstitialAd.
- Returns:
Returns true if the interstitial is ready to be displayed else returns false.
-
setListener
void setListener(@Nullable() POBInterstitial.POBInterstitialListener listener)
Sets instance of POBInterstitialListener for getting callbacks
- Parameters:
listener- Instance of POBInterstitialListener
-
setVideoListener
void setVideoListener(@Nullable() POBInterstitial.POBVideoListener listener)
Sets instance of POBVideoListener for getting callbacks of VAST based video ad
- Parameters:
listener- Instance of POBVideoListener
-
proceedToLoadAd
boolean proceedToLoadAd()
-
proceedOnError
void proceedOnError(@NonNull() POBBidEvent.BidEventError error, @NonNull() String errorMessage)
-
destroy
void destroy()
Invoke this method when your activity/fragment is about to destroy. It cleans the resources.
-
setBidEventListener
void setBidEventListener(@Nullable() POBBidEventListener bidEventListener)
Sets the BidEventListener for the ad view Note: Proper reference management practices should be observed when using this listener
- Parameters:
bidEventListener- reference of POBBidEventListener
-
-
-
-