public interface MessageClient
| Modifier and Type | Interface and Description |
|---|---|
static interface |
MessageClient.ProgressHandler
Progress indicator interface
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete(java.lang.String messageId,
CompletionHandler<java.lang.Void> handler)
Deletes a message by message id.
|
void |
downloadFile(RemoteFile remoteFile,
java.lang.String to,
MessageClient.ProgressHandler progressHandler,
CompletionHandler<android.net.Uri> completionHandler) |
void |
downloadThumbnail(RemoteFile remoteFile,
java.lang.String to,
MessageClient.ProgressHandler progressHandler,
CompletionHandler<android.net.Uri> completionHandler) |
void |
get(java.lang.String messageId,
CompletionHandler<Message> handler)
Retrieves the details for a message by message Id.
|
void |
list(java.lang.String roomId,
java.lang.String before,
java.lang.String beforeMessage,
java.lang.String mentionedPeople,
int max,
CompletionHandler<java.util.List<Message>> handler)
Lists all messages in a room by room Id.
|
void |
post(java.lang.String idOrEmail,
java.lang.String text,
Mention[] mentions,
LocalFile[] files,
CompletionHandler<Message> handler) |
void |
post(java.lang.String roomId,
java.lang.String personId,
java.lang.String personEmail,
java.lang.String text,
java.lang.String markdown,
java.lang.String[] files,
CompletionHandler<Message> handler)
Posts a plain text message, and optionally, a media content attachment, to a room by room Id.
|
void |
setMessageObserver(MessageObserver observer) |
void list(@NonNull
java.lang.String roomId,
@Nullable
java.lang.String before,
@Nullable
java.lang.String beforeMessage,
@Nullable
java.lang.String mentionedPeople,
int max,
@NonNull
CompletionHandler<java.util.List<Message>> handler)
The list sorts the messages in descending order by creation date.
roomId - The identifier of the room.before - If not nil, only list messages sent only before this date and time, in ISO8601 format.beforeMessage - If not nil, only list messages sent only before this message by id.mentionedPeople - If not nil, only list messages mention people.max - The maximum number of messages in the response.handler - A closure to be executed once the request has finished.void post(@Nullable
java.lang.String roomId,
@Nullable
java.lang.String personId,
@Nullable
java.lang.String personEmail,
@Nullable
java.lang.String text,
@Nullable
java.lang.String markdown,
@Nullable
java.lang.String[] files,
@NonNull
CompletionHandler<Message> handler)
roomId - The identifier of the room where the message is to be posted.personId - The identifier of the recipient of this private 1:1 message.personEmail - The email address of the recipient when sending a private 1:1 message.text - The plain text message to be posted to the room.markdown - The markdown text message to be posted to the room.files - A public URL that Cisco Spark can use to fetch attachments. Currently supports only a single URL. Cisco Spark downloads the content from the URL one time shortly after the message is created and automatically converts it to a format that all Cisco Spark clients can render.handler - A closure to be executed once the request has finished.void post(@NonNull
java.lang.String idOrEmail,
@Nullable
java.lang.String text,
@Nullable
Mention[] mentions,
@Nullable
LocalFile[] files,
@NonNull
CompletionHandler<Message> handler)
idOrEmail - The identifier of the room or person or person email where the message is to be posted.text - The plain text message to be posted to the room.mentions - Mention people, if post to a person, this param should be nullfiles - Files to be postedhandler - A closure to be executed once the request has finished.void setMessageObserver(MessageObserver observer)
observer - void downloadFile(RemoteFile remoteFile, java.lang.String to, MessageClient.ProgressHandler progressHandler, CompletionHandler<android.net.Uri> completionHandler)
remoteFile - The RemoteFile object need to be downloaded.to - The local file directory for saving downloaded file.progressHandler - The download progress indicator.completionHandler - A closure to be executed when download completed.void downloadThumbnail(RemoteFile remoteFile, java.lang.String to, MessageClient.ProgressHandler progressHandler, CompletionHandler<android.net.Uri> completionHandler)
remoteFile - The RemoteFile object need to be downloaded.to - The local file directory for saving downloaded file.progressHandler - The download progress indicator.completionHandler - A closure to be executed when download completed.void get(@NonNull
java.lang.String messageId,
@NonNull
CompletionHandler<Message> handler)
messageId - The identifier of the message.handler - A closure to be executed once the request has finished.void delete(@NonNull
java.lang.String messageId,
@NonNull
CompletionHandler<java.lang.Void> handler)
messageId - The identifier of the message.handler - A closure to be executed once the request has finished.