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, @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
      • 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 updated
        placementType - Placement type of the Ad Response