public class MessageEvent

  1. Object
  2. ActionEvent
  3. MessageEvent
Encapsulates an event that either originates outside the App (e.g. from the webpage that contains the app if it is published using the Javascript port); or whose destination is outside the app.

Nested types

class MessageEvent.PromptPromiseEncapsulates a promise that should be fulfilled when implementingn a custom permissions prompt to record or play audio.

Constructors

public MessageEvent(Object source, String message, int code)Creates a new message.

Methods

public String getMessage()Gets the message content.
public int getCode()Gets the message code.
public boolean isPromptForAudioRecorder()Checks to see if this message is a prompt to record audio.
public boolean isPromptForAudioPlayer()Checks to see if this message is a prompt to play audio.
public MessageEvent.PromptPromise getPromptPromise()This obtains the “promise” that should be fulfilled if implementing a custom permissions prompt for playing or recording audio.

Inherited nested types

Inherited methods

Constructor details

MessageEvent

public MessageEvent(Object source, String message, int code)
Creates a new message.

Parameters

source Object
The source of the message.
message String
The message content.
code int
A code for the message.

Method details

getMessage

public String getMessage()
Gets the message content.

Returns

The message

getCode

public int getCode()
Gets the message code.

isPromptForAudioRecorder

public boolean isPromptForAudioRecorder()

Checks to see if this message is a prompt to record audio. This is currently only used in the Javascript port, and it allows you to implement a custom permissions prompt to record audio.

See Displaying Custom Prompt to Play Audio for an example.

Returns

True if this message is a prompt for the audio recorder.

isPromptForAudioPlayer

public boolean isPromptForAudioPlayer()

Checks to see if this message is a prompt to play audio. This is currently only used in the Javascript port, and it allows you to implement a custom permissions prompt to play audio.

See Displaying Custom Prompt to Play Audio for an example.

Returns

True if this message is a prompt for the audio player.

getPromptPromise

public MessageEvent.PromptPromise getPromptPromise()

This obtains the “promise” that should be fulfilled if implementing a custom permissions prompt for playing or recording audio. Currently this is only used for the Javascript port.

See Displaying Custom Prompt to Play Audio for an example.

Returns

The promise to be fulfilled, or null if this event is not a prompt.