The Android Developer Challenge is back! Submit your idea before December 2.

WebMessageCompat

open class WebMessageCompat
kotlin.Any
   ↳ androidx.webkit.WebMessageCompat

The Java representation of the HTML5 PostMessage event. See https://html.spec.whatwg.org/multipage/comms.html#the-messageevent-interfaces for definition of a MessageEvent in HTML5.

Summary

Public constructors

<init>(@Nullable data: String?)

Creates a WebMessage.

<init>(@Nullable data: String?, @Nullable ports: Array<WebMessagePortCompat!>?)

Creates a WebMessage.

Public methods

open String?

Returns the data of the message.

open Array<WebMessagePortCompat!>?

Returns the ports that are sent with the message, or null if no port is sent.

Public constructors

<init>

WebMessageCompat(@Nullable data: String?)

Creates a WebMessage.

Parameters
data String?: the data of the message.

<init>

WebMessageCompat(@Nullable data: String?, @Nullable ports: Array<WebMessagePortCompat!>?)

Creates a WebMessage.

Parameters
data String?: the data of the message.
ports String?: the ports that are sent with the message.

Public methods

getData

@Nullable open fun getData(): String?

Returns the data of the message.

getPorts

@Nullable open fun getPorts(): Array<WebMessagePortCompat!>?

Returns the ports that are sent with the message, or null if no port is sent.