BrazeWebViewClient

open class BrazeWebViewClient(val context: Context, val type: BrazeWebViewClient.Type, inAppMessage: IInAppMessage? = null, inAppMessageWebViewClientListener: IInAppMessageWebViewClientListener? = null, bannerWebViewClientListener: IBannerWebViewClientListener? = null, assetDirectoryUrl: String? = null) : WebViewClient

WebViewClient for Braze HTML content that intercepts URL loading to handle Braze scheme actions (close, custom events), injects the JavaScript bridge, and delegates URL actions to the appropriate listener based on the Type.

Parameters

context

The Android Context.

type

Whether this client serves a Type.BANNER or Type.IN_APP_MESSAGE.

inAppMessage

The in-app message model, required when type is Type.IN_APP_MESSAGE.

inAppMessageWebViewClientListener

Listener for in-app message URL actions.

bannerWebViewClientListener

Listener for banner URL actions.

assetDirectoryUrl

Optional local asset directory for WebView asset loading.

Inheritors

Constructors

Link copied to clipboard
constructor(context: Context, type: BrazeWebViewClient.Type, inAppMessage: IInAppMessage? = null, inAppMessageWebViewClientListener: IInAppMessageWebViewClientListener? = null, bannerWebViewClientListener: IBannerWebViewClientListener? = null, assetDirectoryUrl: String? = null)

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Identifies the Braze message type this BrazeWebViewClient is serving.

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open fun doUpdateVisitedHistory(view: WebView?, url: String?, isReload: Boolean)
Link copied to clipboard
open fun onFormResubmission(view: WebView?, dontResend: Message?, resend: Message?)
Link copied to clipboard
open fun onLoadResource(view: WebView?, url: String?)
Link copied to clipboard
open fun onPageCommitVisible(view: WebView?, url: String?)
Link copied to clipboard
open override fun onPageFinished(view: WebView, url: String)
Link copied to clipboard
open fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?)
Link copied to clipboard
Link copied to clipboard
open fun onReceivedError(view: WebView?, request: WebResourceRequest?, error: WebResourceError?)
open fun onReceivedError(view: WebView?, errorCode: Int, description: String?, failingUrl: String?)
Link copied to clipboard
open fun onReceivedHttpAuthRequest(view: WebView?, handler: HttpAuthHandler?, host: String?, realm: String?)
Link copied to clipboard
open fun onReceivedHttpError(view: WebView?, request: WebResourceRequest?, errorResponse: WebResourceResponse?)
Link copied to clipboard
open fun onReceivedLoginRequest(view: WebView?, realm: String?, account: String?, args: String?)
Link copied to clipboard
open fun onReceivedSslError(view: WebView?, handler: SslErrorHandler?, error: SslError?)
Link copied to clipboard
open override fun onRenderProcessGone(view: WebView, detail: RenderProcessGoneDetail): Boolean
Link copied to clipboard
open fun onSafeBrowsingHit(view: WebView?, request: WebResourceRequest?, threatType: Int, callback: SafeBrowsingResponse?)
Link copied to clipboard
open fun onScaleChanged(view: WebView?, oldScale: Float, newScale: Float)
Link copied to clipboard
open fun onTooManyRedirects(view: WebView?, cancelMsg: Message?, continueMsg: Message?)
Link copied to clipboard
open fun onUnhandledKeyEvent(view: WebView?, event: KeyEvent?)
Link copied to clipboard

Sets a IWebViewClientStateListener to receive page load completion callbacks. If the page has already finished loading, the listener is notified immediately.

Link copied to clipboard
Link copied to clipboard
open fun shouldOverrideKeyEvent(view: WebView?, event: KeyEvent?): Boolean
Link copied to clipboard
open override fun shouldOverrideUrlLoading(view: WebView, request: WebResourceRequest): Boolean

Handles appboy schemed ("appboy://") urls in the HTML content WebViews. If the url isn't appboy schemed, then the url is passed to the attached IInAppMessageWebViewClientListener.

open override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean