Class POBAdsHelper

  • All Implemented Interfaces:

    
    public class POBAdsHelper
    
                        

    Ad specific helper class to add common/util implementation for public ad format classes.

    • Constructor Detail

      • POBAdsHelper

        POBAdsHelper()
    • 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)

        Validates the argument to make sure proper initialization of this object.

        Parameters:
        context - the context required to load ad
        publisherId - ID of publisher in PubMatic system
        adUnitId - Ad-unit ID (Slot name) in PubMatic system
        Returns:

        true when all parameters are not null and not empty

      • 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 ad
        publisherId - ID of publisher in PubMatic system
        adUnitId - Ad-unit ID (Slot name) in PubMatic system
        listener - 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 - Context
        adFormat - Ad format for which impression depth needs to be recorded
      • recordLastAdomainFromBid

         static void recordLastAdomainFromBid(@NonNull() POBAdFormat adFormat, @Nullable() POBBid bid)

        Stores the first entry of adomain from the rendered bid for subsequent lastadomain bid requests for given adFormat.

        The update logic based on the adFormat is as follows:

        • Case 1: For adFormat BANNER_AND_MREC and BANNER response: Updates BANNER_AND_MREC and BANNER
        • Case 2: For adFormat BANNER_AND_MREC and MREC response: Updates BANNER_AND_MREC and MREC
        • Case 3: For adFormat BANNER: Updates BANNER_AND_MREC and BANNER
        • Case 4: For adFormat MREC: Updates BANNER_AND_MREC and MREC
        • Case 5: For adFormat INTERSTITIAL: Updates INTERSTITIAL
        • Case 6: For adFormat REWARDEDAD: Updates REWARDEDAD
        • Case 7: For adFormat NATIVE: Updates NATIVE
        • Case 8: For adFormat APP_OPEN_AD: Updates APP_OPEN_AD
        If the bid or adomain information is null or empty, it logs a debug message and does not perform any update.
        Parameters:
        adFormat - The placement type key used for lastadomain mapping; it determines the target formats to update.
        bid - The winning bid object containing adomain information.
      • updateResponseUsingAdFormatType

        @NonNull() static <T extends POBAdDescriptor> POBAdResponse<T> updateResponseUsingAdFormatType(@NonNull() POBAdResponse<T> adResponse, @NonNull() POBAdFormat adFormat)

        Updated the adResponse with the refresh interval and expiry timeout based on the placement type passed

        Parameters:
        adResponse - Ad Response that needs to be updated
        adFormat - AdFormat type of the Ad Response