@MainThread
public class POBRewardedAd
extends java.lang.Object
implements com.pubmatic.sdk.openwrap.core.POBBidEvent
| Modifier and Type | Class and Description |
|---|---|
static class |
POBRewardedAd.POBRewardedAdListener
Static member class for interaction with the POBRewardedAd instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Invoke this method when your activity/fragment is about to destroy.
|
com.pubmatic.sdk.openwrap.core.POBRequest |
getAdRequest()
Getter for ad request object.
|
java.util.List<com.pubmatic.sdk.openwrap.core.POBReward> |
getAvailableRewards()
This method returns the list of the available rewards for the loaded Ad.
|
com.pubmatic.sdk.openwrap.core.POBBid |
getBid()
Get bid
|
com.pubmatic.sdk.openwrap.core.POBImpression |
getImpression()
Returns an instance of POBImpression which gets created internally.
|
static POBRewardedAd |
getRewardedAd(android.content.Context context,
java.lang.String publisherId,
int profileId,
java.lang.String adUnitId)
Constructor.
|
static POBRewardedAd |
getRewardedAd(android.content.Context context,
java.lang.String publisherId,
int profileId,
java.lang.String adUnitId,
POBRewardedAdEvent eventHandler)
Constructor.
|
boolean |
isReady()
Method to check whether the ad is loaded and ready to show RewardedAd.
|
void |
loadAd()
Initiate the loading of a rewarded ad.
|
void |
proceedOnError(com.pubmatic.sdk.openwrap.core.POBBidEvent.BidEventError error) |
boolean |
proceedToLoadAd() |
void |
setBidEventListener(com.pubmatic.sdk.openwrap.core.POBBidEventListener bidEventListener)
Sets the BidEventListener for the ad view
Note: Proper reference management practices should be observed when using this listener
|
void |
setListener(POBRewardedAd.POBRewardedAdListener rewardedAdListener)
Sets instance of class as a listener to get rewarded ad callbacks
|
void |
setSkipAlertDialogInfo(java.lang.String title,
java.lang.String message,
java.lang.String resumeTitle,
java.lang.String closeTitle)
To set info to skip alert dialog, use/set this before calling
loadAd() method. |
void |
show()
Presents an rewarded ad in full screen view until the user dismisses it.
|
void |
show(java.util.Map<java.lang.String,java.lang.Object> customData)
Presents an Rewarded ad in full screen view until the user dismisses it.
|
@Nullable public static POBRewardedAd getRewardedAd(@NonNull android.content.Context context, @NonNull java.lang.String publisherId, int profileId, @NonNull java.lang.String adUnitId)
destroy() for every ad instance created.context - Activity/Application contextpublisherId - Identifier of the publisherprofileId - Profile ID of an ad tagadUnitId - Ad unit id used to identify unique placement on screen@Nullable public static POBRewardedAd getRewardedAd(@NonNull android.content.Context context, @NonNull java.lang.String publisherId, int profileId, @NonNull java.lang.String adUnitId, @NonNull POBRewardedAdEvent eventHandler)
context - Activity/Application contextpublisherId - Identifier of the publisherprofileId - Profile ID of an ad tagadUnitId - Ad unit id used to identify unique placement on screeneventHandler - Valid instance of POBRewardedAdEventpublic void setListener(@Nullable
POBRewardedAd.POBRewardedAdListener rewardedAdListener)
rewardedAdListener - Instance of POBRewardedAdListenerpublic void setSkipAlertDialogInfo(@NonNull
java.lang.String title,
@NonNull
java.lang.String message,
@NonNull
java.lang.String resumeTitle,
@NonNull
java.lang.String closeTitle)
loadAd() method.
Note: This method validate parameter values, if one of the parameter is null or empty then the skip alert uses
default values.title - the title for skip alert dialogmessage - the message for skip alert dialogresumeTitle - the resume button title for skip alert dialogcloseTitle - the close button title for skip alert dialogpublic void loadAd()
@Nullable public com.pubmatic.sdk.openwrap.core.POBImpression getImpression()
@Nullable public com.pubmatic.sdk.openwrap.core.POBRequest getAdRequest()
public void show()
public void show(@Nullable
java.util.Map<java.lang.String,java.lang.Object> customData)
customData - Publisher should pass the custom data to be used for Reward selection like:
Select the rewards among the multiple configured rewards and pass it in
this method. For example:
HashMap customDataMap = new HashMap(1);
List availableRewards = owRewardedAd.getAvailableRewards();
if(availableRewards != null && availableRewards.size()>0) {
// Use your own logic for reward selection
customDataMap.put(OpenWrapSDK.KEY_SELECTED_REWARD, availableRewards.get(0));
}
owRewardedAd.show(customDataMap);
Note: In case multiple rewards are configured then passing the selected
reward is mandatory. Else, OW SDK will consider any random reward from the
configured rewards.@Nullable public java.util.List<com.pubmatic.sdk.openwrap.core.POBReward> getAvailableRewards()
public boolean isReady()
public void destroy()
public void setBidEventListener(@Nullable
com.pubmatic.sdk.openwrap.core.POBBidEventListener bidEventListener)
setBidEventListener in interface com.pubmatic.sdk.openwrap.core.POBBidEventbidEventListener - reference of POBBidEventListenerpublic boolean proceedToLoadAd()
proceedToLoadAd in interface com.pubmatic.sdk.openwrap.core.POBBidEventpublic void proceedOnError(@NonNull
com.pubmatic.sdk.openwrap.core.POBBidEvent.BidEventError error)
proceedOnError in interface com.pubmatic.sdk.openwrap.core.POBBidEvent@Nullable public com.pubmatic.sdk.openwrap.core.POBBid getBid()
getBid in interface com.pubmatic.sdk.openwrap.core.POBBidEvent