H5AdsRequestHandler

public final class H5AdsRequestHandler extends Object

Handles H5 ad requests.

If using a 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(String).

Public Constructor Summary

H5AdsRequestHandler(Context context, OnH5AdsEventListener onH5AdsEventListener)
Constructs an H5AdsRequestHandler.

Public Method Summary

void
clearAdObjects()
Destroys all ads being managed by H5 ads.
boolean
handleH5AdsRequest(String url)
Attempts to handle an H5 ads request.
boolean
shouldInterceptRequest(String url)
Returns true if request is for H5 ads, false otherwise.

Inherited Method Summary

Public Constructors

public H5AdsRequestHandler (Context context, OnH5AdsEventListener onH5AdsEventListener)

Constructs an H5AdsRequestHandler.

Public Methods

public void clearAdObjects ()

Destroys all ads being managed by H5 ads.

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

public boolean handleH5AdsRequest (String url)

Attempts to handle an H5 ads request.

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

public boolean shouldInterceptRequest (String url)

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