Package com.pubmatic.sdk.openwrap.core
Class POBAdsHelper
-
- All Implemented Interfaces:
public class POBAdsHelperAd specific helper class to add common/util implementation for public ad format classes.
-
-
Constructor Summary
Constructors Constructor Description POBAdsHelper()
-
Method Summary
Modifier and Type Method Description static POBImpressiongetImpression(@Nullable() POBRequest request)Returns an instance of impression object created internally. static booleanvalidate(@Nullable() Context context, @Nullable() String publisherId, @Nullable() String adUnitId, @Nullable() Object listener)Validates the argument to make sure proper initialization of this object. static voidrecordImpressionDepth(@NonNull() Context context, @NonNull() POBAdFormat adFormat)Record impression depth for the given ad format static <T extends POBAdDescriptor> POBAdResponse<T>updateResponseUsingPlacementType(@NonNull() POBAdResponse<T> adResponse, @NonNull() String placementType)Updated the adResponse with the refresh interval and expiry timeout based on the placement type passed static POBImpressioncreateFullScreenImpression(@NonNull() Context context, @NonNull() String adUnitId, @NonNull() POBAdFormat adFormat)Creates an impression using the provided ad unit id and adFormat. -
-
Method Detail
-
getImpression
@Nullable() static POBImpression getImpression(@Nullable() POBRequest request)
Returns an instance of impression object created internally. It provides APIs to set pubmatic zone id and other custom parameters.
- Returns:
Returns an instance of POBImpression.
-
validate
static boolean validate(@Nullable() Context context, @Nullable() String publisherId, @Nullable() String adUnitId, @Nullable() Object listener)
Validates the argument to make sure proper initialization of this object.
- Parameters:
context- the context required to load adpublisherId- ID of publisher in PubMatic systemadUnitId- Ad-unit ID (Slot name) in PubMatic systemlistener- Valid instance of POBBaseEvent- Returns:
true when all parameters are not null and not empty
-
recordImpressionDepth
static void recordImpressionDepth(@NonNull() Context context, @NonNull() POBAdFormat adFormat)
Record impression depth for the given ad format
- Parameters:
context- ContextadFormat- Ad format for which impression depth needs to be recorded
-
updateResponseUsingPlacementType
@NonNull() static <T extends POBAdDescriptor> POBAdResponse<T> updateResponseUsingPlacementType(@NonNull() POBAdResponse<T> adResponse, @NonNull() String placementType)
Updated the adResponse with the refresh interval and expiry timeout based on the placement type passed
- Parameters:
adResponse- Ad Response that needs to be updatedplacementType- Placement type of the Ad Response
-
createFullScreenImpression
@Nullable() static POBImpression createFullScreenImpression(@NonNull() Context context, @NonNull() String adUnitId, @NonNull() POBAdFormat adFormat)
Creates an impression using the provided ad unit id and adFormat.
- Parameters:
context- Application context for permission checksadUnitId- ad unit id.adFormat- ad format .- Returns:
Impression object
-
-
-
-