JsMessaging

interface JsMessaging

Properties

Link copied to clipboard
abstract val allowedDomains: List<String>

List of domains where the interface can be added

Link copied to clipboard
abstract val callbackName: String

Name of the JS callback

Link copied to clipboard
abstract val context: String

Context name

Link copied to clipboard
abstract val secret: String

Secret to use in the JS code

Functions

Link copied to clipboard
abstract fun onResponse(response: JsCallbackData)

Method to send a response back to the JS code. Takes a JsCallbackData and uses it to create the response and send it.

Link copied to clipboard
abstract fun process(message: String, secret: String)

JS Interface to process a message

Link copied to clipboard
abstract fun register(webView: WebView, jsMessageCallback: JsMessageCallback?)

Method to register the JS interface to the webView instance

Link copied to clipboard
abstract fun sendSubscriptionEvent(subscriptionEventData: SubscriptionEventData)

Method to send a subscription event