H5AdsRequestHandler

class H5AdsRequestHandler


Handles H5 ad requests.

If using a android.webkit.WebView, use H5AdsWebViewClient instead of this class.

Otherwise, if using an alternative web view, create an instance of this class, and pass every web request to handleH5AdsRequest.

Summary

Public constructors

H5AdsRequestHandler(
    context: Context!,
    onH5AdsEventListener: OnH5AdsEventListener!
)

Constructs an H5AdsRequestHandler.

Public functions

Unit

Destroys all ads being managed by H5 ads.

Boolean

Attempts to handle an H5 ads request.

Boolean

Returns true if request is for H5 ads, false otherwise.

Public constructors

H5AdsRequestHandler

H5AdsRequestHandler(
    context: Context!,
    onH5AdsEventListener: OnH5AdsEventListener!
)

Constructs an H5AdsRequestHandler.

Public functions

clearAdObjects

fun clearAdObjects(): Unit

Destroys all ads being managed by H5 ads.

Note: This method has no effect on any ads instantiated by non-H5 APIs, such as and .

handleH5AdsRequest

fun handleH5AdsRequest(url: String!): Boolean

Attempts to handle an H5 ads request.

Returns
Boolean

true if the request was an H5 ads request, false otherwise.

shouldInterceptRequest

fun shouldInterceptRequest(url: String!): Boolean

Returns true if request is for H5 ads, false otherwise.