WidgetPostAPIMediator

interface WidgetPostAPIMediator

Types

Link copied to clipboard
interface Handler

Functions

Link copied to clipboard
abstract fun clearWebView()

This clear the mediator by removing the JavaScript Interface and cleaning references.

Link copied to clipboard
abstract fun injectAPI()

Inject the necessary javascript into the configured WebView. Should be called after a web page has been loaded.

Link copied to clipboard
abstract fun sendBoolResponse(response: Boolean, eventData: JsonDict)

Send a boolean response.

Link copied to clipboard
abstract fun sendError(message: String, eventData: JsonDict)

Send an error.

Link copied to clipboard
abstract fun sendIntegerResponse(response: Int, eventData: JsonDict)

Send an integer response.

Link copied to clipboard
abstract fun <T> sendObjectResponse(    type: Type,     response: T?,     eventData: JsonDict)

Send an object response.

Link copied to clipboard
abstract fun sendSuccess(eventData: JsonDict)

Send success.

Link copied to clipboard
abstract fun setHandler(handler: WidgetPostAPIMediator.Handler?)

Set handler to communicate with the widgetPostAPIMediator. Please remove the reference by passing null when finished.

Link copied to clipboard
abstract fun setWebView(webView: WebView)

This initialize the webview to handle. It will add a JavaScript Interface. Please call clearWebView method when finished to clean the provided webview