BlazeIMADelegate - React Native

export interface BlazeIMADelegate {

    /**
     * This function will be triggered every time an event on an ad will happen.
     * 
     * @param params The data associated with the ad involved in the event.
     */
    onIMAAdEvent?: (params: BlazeIMADelegateOnAdEventParams) => void;

    /**
      * Called when an error occurs during ad loading or playback.
      * 
      * @param errorMessage The error message associated with the error.
      */
    onIMAAdError?: (errorMessage: string) => void;

    /**
     * The SDK always sets `ad_rule=0` on the ad tags it builds, so an `ad_rule` returned here is overridden.
     * 
     * @param params The request data information provides additional info regarding the current ad request.
     * @returns Additional query parameters to be included in the ad tag.
     */
    additionalIMATagQueryParams?: (params: BlazeIMAAdRequestParams) => Record<string, string>;

    /**
     * 
     * @param params The request data information provides additional info regarding the current ad request.
     * @returns Custom settings for the IMA SDK.
     */
    customIMASettings?: (params: BlazeIMAAdRequestParams) => BlazeIMASettings | undefined;

    /**
     * Overrides the default ad tag URL with a custom one. This URL will be used for the ad request.
     * 
     * The returned string is used verbatim, with no enrichment or percent-encoding, so it must already be a
     * fully-encoded `http`/`https` URL with a host, or the request is rejected.
     *
     * @param params The request data information provides additional info regarding the current ad request.
     * @returns the override ad tag URL to be used for the ad request.
     */
    overrideAdTagUrl?: (params: BlazeIMAAdRequestParams) => string | undefined;

}

Functions

onIMAAdEvent

This function will be triggered by our SDK whenever there's an event related to ads. You can find more about the params here.


onIMAAdError

Called when an error occurs during ad operations.


additionalIMATagQueryParams

Returns additional query parameters for the ad tag the SDK builds. From React Native SDK 1.21.0, the SDK percent-encodes the ad tags it builds and always sets ad_rule=0 on them, so an ad_rule returned here is overridden.


overrideAdTagUrl

Returns an ad tag URL that replaces the one the SDK builds. The SDK uses the returned string verbatim, with no enrichment or percent-encoding, so it must already be a fully-encoded http/https URL with a host, or the ad request is rejected.


Did this page help you?