R89WebViewClient

open class R89WebViewClient(appHostName: String) : WebViewClient

This class is used to add the consent data to the url that is being loaded in the WebView. And Prevent the CMP to show up in the web, which would mean that the CMP is prompted twice.

For this we are injecting a script in the header of the web to load. This script is just setting a variable to true so the CMP doesn't show up. And also whenever we call a WebView.loadUrl we are adding the consent data to the url and overriding the load to load it again.

if you need to override shouldInterceptRequest override r89ShouldInterceptRequest instead.

Constructors

Link copied to clipboard
constructor(appHostName: String)

Functions

Link copied to clipboard
Link copied to clipboard
open fun onFormResubmission(p0: WebView, p1: Message, p2: Message)
Link copied to clipboard
open fun onLoadResource(p0: WebView, p1: String)
Link copied to clipboard
Link copied to clipboard
open fun onPageFinished(p0: WebView, p1: String)
Link copied to clipboard
override fun onPageStarted(webView: WebView?, url: String?, favicon: Bitmap?)

This function is called when the web starts loading a url. look at WebViewClient.onPageStarted

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun onReceivedLoginRequest(p0: WebView, p1: String, p2: String?, p3: String)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun onScaleChanged(p0: WebView, p1: Float, p2: Float)
Link copied to clipboard
open fun onTooManyRedirects(p0: WebView, p1: Message, p2: Message)
Link copied to clipboard
Link copied to clipboard
open fun r89OnPageStarted(webView: WebView?, url: String?, favicon: Bitmap?)

The way to get notified when WebViewClient.onPageStarted is called

Link copied to clipboard

This will be called before the shouldInterceptRequest but we can't allow overriding shouldInterceptRequest because we need it to include cmp data when loading a web inside appHostName domain.

Link copied to clipboard

we are overriding the default behaviour to add the consent data to the url and load it again.

Link copied to clipboard