Representation of a Chat Message object.
More...
Representation of a Chat Message object.
JSONObject com.twilio.chat.Message.getAttributes |
( |
| ) |
throws JSONException |
Retrieve attributes associated with this message.
- Returns
- the message attributes map.
- Exceptions
-
JSONException | If attributes could not be parsed. |
native String com.twilio.chat.Message.getAuthor |
( |
| ) |
|
The global identity of the author of this message.
- Returns
- The global identity.
native Channel com.twilio.chat.Message.getChannel |
( |
| ) |
|
Returns the parent channel this message belongs to.
- Returns
- Channel.
native String com.twilio.chat.Message.getChannelSid |
( |
| ) |
|
Returns the channel SID of the channel this message belongs to.
- Returns
- Channel SID.
native String com.twilio.chat.Message.getDateCreated |
( |
| ) |
|
The creation date for this message.
- Returns
- The time stamp when this message was created.
Date com.twilio.chat.Message.getDateCreatedAsDate |
( |
| ) |
|
The creation timestamp for this message.
- Returns
- Date when this message was created or null if date string could not be parsed.
- Since
- 3.0.2
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.
- Returns
- Media descriptor with all information about the media including the output stream to write it to. Or null if no media is available.
native Member com.twilio.chat.Message.getMember |
( |
| ) |
|
Returns the member this message sent by.
- Returns
- Member.
native String com.twilio.chat.Message.getMemberSid |
( |
| ) |
|
Returns the member SID of the member this message sent by.
- Returns
- Member SID.
String com.twilio.chat.Message.getMessageBody |
( |
| ) |
|
The body for this message.
- Returns
- The message body.
native long com.twilio.chat.Message.getMessageIndex |
( |
| ) |
|
Returns the index number for this message.
- Returns
- the message index.
native Messages com.twilio.chat.Message.getMessages |
( |
| ) |
|
Returns the parent messages object this message belongs to.
- Returns
- Messages.
native String com.twilio.chat.Message.getSid |
( |
| ) |
|
Returns the identifier for this message.
- Returns
- The message SID.
native Type com.twilio.chat.Message.getType |
( |
| ) |
|
- Returns
- message type. If message has media type then getMedia shall return the descriptor for the attached media.
boolean com.twilio.chat.Message.hasMedia |
( |
| ) |
|
Helper method to check if message has media type.
- Returns
- true if message has type MEDIA, false otherwise.
if (message.hasMedia()) {
Message.Media media = message.getMedia();
}
static Options com.twilio.chat.Message.options |
( |
| ) |
|
|
static |
Options builder.
Use for constructing new message options in Messages#sendMessage.
- Returns
- New empty Options object.
Message.options()
.withMedia(new FileInputStream("/path/to/Somefile.txt"), "text/plain")
.withMediaFileName("file.txt");
void com.twilio.chat.Message.setAttributes |
( |
JSONObject |
updatedAttributes, |
|
|
StatusListener |
listener |
|
) |
| |
Change attributes associated with this message.
- Parameters
-
updatedAttributes | Message attributes map to fully replace old attributes. |
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.
- Parameters
-
body | The body for the message. |
listener | Listener that will receive callback of the result. |