Chat Android SDK
5.1.0
|
Representation of a Chat Message object. More...
Classes | |
class | Media |
Media object describes downloadable media inside chat message with type Message.Type.MEDIA. More... | |
class | Options |
Used to construct new message before sending. More... | |
enum | Type |
Represents the type of message. More... | |
enum | UpdateReason |
Indicates reason for message update. More... | |
Public Member Functions | |
Getters | |
native String | getSid () |
Returns the identifier for this message. More... | |
native String | getAuthor () |
The global identity of the author of this message. More... | |
native String | getDateCreated () |
The creation date for this message. More... | |
Date | getDateCreatedAsDate () |
The creation timestamp for this message. More... | |
String | getMessageBody () |
The body for this message. More... | |
native String | getChannelSid () |
Returns the channel SID of the channel this message belongs to. More... | |
native Channel | getChannel () |
Returns the parent channel this message belongs to. More... | |
native String | getMemberSid () |
Returns the member SID of the member this message sent by. More... | |
native Member | getMember () |
Returns the member this message sent by. More... | |
native Messages | getMessages () |
Returns the parent messages object this message belongs to. More... | |
native long | getMessageIndex () |
Returns the index number for this message. More... | |
Attributes | getAttributes () |
Retrieve attributes associated with this message. More... | |
native Type | getType () |
boolean | hasMedia () |
Helper method to check if message has media type. More... | |
Media | getMedia () |
Get media descriptor of an associated media attachment, if exists. More... | |
Setters | |
void | updateMessageBody (String body, StatusListener listener) |
Updates the body for a message. More... | |
void | setAttributes (Attributes attributes, StatusListener listener) |
Set attributes associated with this message. More... | |
Static Public Member Functions | |
Builders | |
static Options | options () |
Options builder. More... | |
Representation of a Chat Message object.
Attributes com.twilio.chat.Message.getAttributes | ( | ) |
Retrieve attributes associated with this message.
native String com.twilio.chat.Message.getAuthor | ( | ) |
The global identity of the author of this message.
native Channel com.twilio.chat.Message.getChannel | ( | ) |
Returns the parent channel this message belongs to.
native String com.twilio.chat.Message.getChannelSid | ( | ) |
Returns the channel SID of the channel this message belongs to.
native String com.twilio.chat.Message.getDateCreated | ( | ) |
The creation date for this message.
Date com.twilio.chat.Message.getDateCreatedAsDate | ( | ) |
The creation timestamp for this message.
Media com.twilio.chat.Message.getMedia | ( | ) |
Get media descriptor of an associated media attachment, if exists.
If the message type is TEXT this method will return null.
native Member com.twilio.chat.Message.getMember | ( | ) |
Returns the member this message sent by.
native String com.twilio.chat.Message.getMemberSid | ( | ) |
Returns the member SID of the member this message sent by.
String com.twilio.chat.Message.getMessageBody | ( | ) |
The body for this message.
native long com.twilio.chat.Message.getMessageIndex | ( | ) |
Returns the index number for this message.
By design of the chat system the message indices may have arbitrary gaps between them, that does not necessarily mean they were deleted or otherwise modified - just that messages may have non-contiguous indices even if they are sent immediately one after another.
Trying to use indices for some calculations is going to be unreliable.
To calculate the number of unread messages it is better to use the consumption horizon API. See Channel#getUnconsumedMessagesCount for details.
native Messages com.twilio.chat.Message.getMessages | ( | ) |
Returns the parent messages object this message belongs to.
native String com.twilio.chat.Message.getSid | ( | ) |
Returns the identifier for this message.
native Type com.twilio.chat.Message.getType | ( | ) |
boolean com.twilio.chat.Message.hasMedia | ( | ) |
Helper method to check if message has media type.
|
static |
Options builder.
Use for constructing new message options in Messages#sendMessage.
void com.twilio.chat.Message.setAttributes | ( | Attributes | attributes, |
StatusListener | listener | ||
) |
Set attributes associated with this message.
Passing null
will reset message attributes to an empty json object.
attributes | The new developer-provided Attributes for this message. |
listener | Listener that will receive callback with the result. |
void com.twilio.chat.Message.updateMessageBody | ( | String | body, |
StatusListener | listener | ||
) |
Updates the body for a message.
body | The body for the message. |
listener | Listener that will receive callback of the result. |