Interface Connection

The connection is added to the page as a JavascriptInterface.

interface Connection {
    inbox?: PubSub<[requestId: number, event: Event]>;
    post(eventJson: string): string;
}

Properties

Methods

Properties

inbox?: PubSub<[requestId: number, event: Event]>

The pub-sub to which Android publishes request IDs and corresponding response events.

Request ID is either a non-negative number returned from Connection.post, or -2 if it is a org.racehorse.NoticeEvent instance that was pushed by Android.

Methods

  • Delivers a serialized event to Android.

    Parameters

    • eventJson: string

      The serialized event.

    Returns string

    The unique request ID.