Skip to content

Additional features of Rox.Chat Mobile SDK for Android

This article contains features of Rox.Chat Mobile SDK for Android that are not available by default. To connect them, please contact technical support.

N.B.

This article is a supplement to the main manual on Rox.Chat Mobile SDK for Android.

Class Rox

Class method newFAQBuilder()

Method needed to get an object FAQBuilder, which in turn is needed to create an instance of class FAQ.

Does not accept parameters.

Returns an instance of class FAQBuilder, which is needed to handle the FAQ block.

Does not throw exceptions.

Does not require other methods to be called beforehand.

Class FAQBuilder

A class whose instance is used to get an instance of class FAQ. An instance of the class is obtained using the newFAQBuilder() method of the Rox class.

Class method setAccountName(String accountName)

The method is required to set the account name in the Rox.Chat system when creating a FAQ block.

The accountName parameter is the name of the client's account in the Rox.Chat system. Usually it is a URL-server (for example, https://demo.rox.chat), but it can also be a single word account name (for example, "demo"), if the server is in the rox.chat domain. The parameter type is String.

Returns the same instance of class FAQBuilder, but with the account name set.

Does not throw exceptions.

Requires a previously obtained instance of class FAQBuilder. A method call is required to get an instance of class FAQ.

Class method build()

A method that is called at the conclusion of the above methods to get an instance of FAQ.

Does not accept parameters.

Returns a FAQ object with the parameters set using the rest of the class instance methods.

Throws an IllegalArgumentException if no account name has been set (see the setAccountName(String accountName) method),

Requires a previously obtained instance of class FAQBuilder, and a subsequent call to methods setAccountName(String accountName).


FAQ interface

An interface that allows manipulation of the FAQ block. It is implemented by internal SDK entities.

An instance of class FAQ is obtained using methods of class FAQBuilder.

Method resume()

When an instance of class FAQ is created, its corresponding FAQ block is in a suspended state. This method is required to kick off network activity.

Does not accept parameters.

Does not return anything.

Throws an IllegalStateException if the FAQ block object has been deactivated (see the destroy() method).

Throws a RuntimeException if the method was called from a thread other than the one in which the class object was created.

Does not require any other methods to be called beforehand. Necessary for the service to function fully in the application context.

The speed of method execution depends on the speed of receiving the server response.

Method pause()

A method that is used to suspend the network activity of the FAQ block. If the session is already in a suspended state, the method does not perform any action.

Does not accept parameters.

Does not return anything.

Throws a RuntimeException if the method was called from a thread other than the one in which the class object was created.

Does not require any other methods to be called beforehand. The FAQ block must not be in a deactivated state for the method to be called.

Method destroy()

A method that is used to deactivate the FAQ block and the class instance. Once this method is called, no methods related to the FAQ block can be used.

Does not accept parameters.

Returns nothing.

Throws a RuntimeException if the method was called from a thread other than the one in which the class object was created.

Does not require any other methods to be called beforehand.

Method getStructure(int rootId, getStructureCallback callback)

Method used to get an object of class FAQStructure via GetStructureCallback. If the query fails, the resulting structure will be null.

Parameter rootId - ID of the node that will be the root of the tree (structure) of the FAQ block. The type is Int.

The callback parameter is an object that implements the GetStructureCallback interface.

Does not return anything.

Throws a RuntimeException if the method was called from a thread other than the one in which the class object was created.

Does not require any other methods to be called beforehand.

Method getCategory(int id, getCategoryCallback callback)

Method used to retrieve an object of class FAQCategory via GetCategoryCallback. If the query fails, the retrieved category will be null.

Parameter ID - category ID of the FAQ block. The type is Int.

The callback parameter is an object implementing the GetCategoryCallback interface.

Does not return anything.

Throws a RuntimeException if the method was called from a thread other than the one in which the class object was created.

Does not require any other methods to be called beforehand.

Method getItem(String id, getItemCallback callback)

Method used to retrieve an object of class FAQItem via GetItemCallback. If the request fails, the retrieved page will be null.

Parameter ID - page ID of the FAQ block. Type - String.

The callback parameter is an object that implements the GetItemCallback interface.

Does not return anything.

Throws a RuntimeException if the method was called from a thread other than the one in which the class object was created.

Does not require any other methods to be called beforehand.


Interface FAQCategory

The category representation of the FAQ block. Provides methods for retrieving information about the category.

FAQCategory objects can be retrieved using a class that implements the GetCategoryCallback interface.

Method getId()

Takes no parameters.

Returns the identifier of the category. The type is Int.

Does not throw any exceptions.

Does not require any other methods to be called beforehand.

Method getTitle()

Takes no parameters.

Returns the title of the category. Type is String.

Does not throw any exceptions.

Does not require any other methods to be called beforehand.

Method getItems()

The category contains the pages of the FAQ block.

Does not take any parameters.

Returns the pages belonging to the category. The type is List<FAQItem>.

Does not throw any exceptions.

Does not require any other methods to be called beforehand.

Method getSubcategories()

A category contains subcategories. For convenience, this method returns subcategory information without its pages and subcategories.

Accepts no parameters.

Returns information about subcategories belonging to a category. The type is List<FAQCategoryInfo>.

Does not throw any exceptions.

Does not require any other methods to be called beforehand.


Interface FAQCategoryInfo

Representation of the category information of the FAQ block. Provides methods to retrieve the category identifier and title.

The FAQCategoryInfo objects can be retrieved using the getSubcategories() method.

Method getId()

Takes no parameters.

Returns the category identifier. Type is Int.

Does not throw any exceptions.

Does not require any other methods to be called beforehand.

Method getTitle()

Takes no parameters.

Returns the title of the category. Type is String.

Does not throw any exceptions.

Does not require any other methods to be called beforehand.


Interface FAQItem

Representation of the FAQ block page. Provides methods for retrieving information about the page.

The FAQItem objects can be retrieved using a class that implements the GetItemCallback interface.

Method getId()

Takes no parameters.

Returns the identifier of the page. Type is String.

Does not throw any exceptions.

Does not require any other methods to be called beforehand.

Method getTitle()

Takes no parameters.

Returns the title of the page. Type is String.

Does not throw any exceptions.

Does not require any other methods to be called beforehand.

Method getCategories()

A page can belong to multiple categories.

Does not take any parameters.

Returns the identifiers of the categories the page belongs to. The type is List.

Does not throw any exceptions.

Does not require any other methods to be called beforehand.

Method getTags()

The page has a set of tags.

Does not take any parameters.

Returns a list of tags that the page is tagged with. The type is List.

Does not throw any exceptions.

Does not require any other methods to be called beforehand.

Method getContent()

Takes no parameters.

Returns the content of the page. Type is String.

Does not throw any exceptions.

Does not require any other methods to be called beforehand.

Method getLikeCount()

The page contains the number of "Like" marks.

Takes no parameters.

Returns the number of "Like" marks of the page. Type is Int.

Throws no exceptions.

Does not require any other methods to be called beforehand.

Method getDislikeCount()

The page contains the number of "Dislike" marks of the page.

Takes no parameters.

Returns the number of dislike marks of the page. Type is Int.

Does not throw any exceptions.

Does not require any other methods to be called beforehand.


Interface FAQStructure

Representation of the tree (structure) of the FAQ block. Provides methods to retrieve information about the tree of the FAQ block.

The FAQStructure objects can be retrieved using a class that implements the GetStructureCallback interface.

Method getId()

The tree has a root element.

Takes no parameters.

Returns the identifier of the root element of the tree. The type is String.

Does not throw any exceptions.

Does not require any other methods to be called beforehand.

Method getTitle()

Takes no parameters.

Returns the title of the root. The type is String.

Does not throw any exceptions.

Does not require any other methods to be called beforehand.

Method getType()

The root of the tree can be a category or a page.

Does not take any parameters.

Returns the type of the root element. The type is FAQType.

Does not throw any exceptions.

Does not require any other methods to be called beforehand.

Method getChildren()

Takes no parameters.

Returns subtrees whose roots are direct descendants of the root of the tree (structure). The type is List<FAQStructure>.

Does not throw any exceptions.

Does not require any other methods to be called beforehand.


Enumerated type FAQType

Possible types of the root of the FAQ block tree (see the getType() method of the FAQStructure interface).

Case ITEM

The root of the tree is a page.

Case CATEGORY

The root of the tree is a category.

Case UNKNOWN

The root of the tree has an unknown type for this version of the SDK.


Enumerated type UserRate

The page can be user-rated.

Case like

The user liked the page.

Case dislike

The user did not like the page.

Case noRate

The page is not rated by the user.


Enumerated type FAQAccessError

The type value corresponds to errors that may be thrown by some FAQ protocol methods.

Case invalidThread

Occurs when a method was called from a thread other than the thread in which the FAQ block instance was created.

Case invalidFaq

Occurs when methods of an invalid instance of FAQ are attempted (e.g., after the destroy() method has been called on it).


Enumerated type FAQBuilderError

The type values correspond to possible errors that may occur when calling the build() method of the FAQBuilder class.

Case nilAccountName

Occurs when no account name value was passed in when creating the FAQ block.


Enumerated type FAQGetCallbackError

Possible errors that may be thrown by FAQ protocol methods.

Case ERROR

Error encountered.


Enumerated type FAQItemSource

The possible source of the article. The article can come from a search or from a structure or category.

The article is requested from a search.

Case tree

The article is requested from a structure or category.


Interface GetStructureCallback

An interface whose methods are implemented by some application class.

An object subject to the interface can be passed in the callback parameter of the getStructure(int rootId, getStructureCallback callback) method of the FAQ interface.

Method receive(FAQStructure structure)

The method is called when getting the tree (structure) of the FAQ block categories using the getStructure(int rootId, getStructureCallback callback) method of the FAQ interface.

The structure parameter is the tree (structure) of the FAQ block categories. The type is FAQStructure.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

The method will be called after the getStructure(int rootId, getStructureCallback callback) method completes.


Interface GetCategoryCallback

An interface whose methods are implemented by some application class.

An object subject to the interface can be passed in the callback parameter of the getCategory(int id, getCategoryCallback callback) method of the FAQ interface.

Method receive(FAQCategory category)

The method is called when the FAQ block category is retrieved by the getCategory(int id, getCategoryCallback callback) method of the FAQ interface.

The category parameter is the category of the FAQ block. The type is FAQCategory.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

The method will be called after the getCategory(int id, getCategoryCallback callback) method completes.


Interface GetItemCallback

An interface whose methods are implemented by some application class.

An object subject to the interface can be passed in the callback parameter of the getItem(String id, getItemCallback callback) method of the FAQ interface.

Method receive(FAQItem item)

The method is called when the FAQ block page is retrieved by the getItem(String id, getItemCallback callback) method of the FAQ interface.

The item parameter is the page of the FAQ block. The type is FAQItem.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

The method will be called after the getItem(String id, getItemCallback callback) method completes.


Enumerated type RootType

Possible types of the root of the FAQ block tree (see the getType() method of the FAQStructure protocol).

Case item

The root of the tree is a page.

Case category

The root of the tree is a category.

Case unknown

The root of the tree has an unknown type for this version of the SDK.


Class SessionBuilder

Method setPrechatFields(String prechatFields)

A method that can be used to set fields with additional information that will be visible to the operator.

The prechatFields parameter is fields with additional information in JSON format. The parameter type is String.

Returns the same instance of the SessionBuilder class, but with the fields set.

Does not throw exceptions.

Requires a previously obtained instance of class SessionBuilder. Method call is not required to get an instance of class RoxSession.

Method setMultivistorSection(String multivisitorSection)

Method that can be used to set settings to receive push notifications from Rox.Chat service when multiple sessions are running on the same device.

The multivisitorSection parameter type is String.

Returns the same instance of class SessionBuilder, but with the field set.

To get an instance of class RoxSession, the method call is optional.

Method setOnlineStatusRequestFrequencyInMillis(long requestFrequency)

A method to specify the frequency of requests to the server in milliseconds.

The requestFrequency parameter is long.

Returns the same instance of class SessionBuilder, but with the corresponding option value set manually.


Protocol RoxSession

Method changeLocation(String location)

This method is used to change the name of a location within an existing session. Calling the method is roughly analogous to the result of creating a new session with similar parameters, but with a different location name.

The location parameter is the name of the location to which the current session value should be changed. The type is String.

May throw errors like AccessError.

The session must not be in suspended or deactivated state to call the method (see methods resume(), pause() and destroy()).


Interface Message

Method getSticker()

Returns an object of type Sticker.

Throws no exceptions.

Method canVisitorReact()

Method returns true if the visitor can react to the message, otherwise returns false.

Does not throw exceptions.

Method canVisitorChangeReaction()

This method returns true if the visitor can change the response left to the message, otherwise it returns false.

Does not throw exceptions.

Method getReaction()

Method returns the visitor's reaction to messages. The return type is MessageReaction.


Interface Sticker

Method getStickerId()

Returns the id of a sticker of type int.


Enumerated type MessageReaction

Case LIKE

The visitor liked the operator's message.

Case DISLIKE

The visitor did not like the operator's message.


Enumerated type AttachmentState

Case externalChecks

The file is checked by the server.


Interface MessageStream

Method rateOperator(int id, String note, int rate, RateOperatorCallback rateOperatorCallback)

Use this method to send the operator rate of the current visitor with a comment.

The id parameter is the ID of the operator whose evaluation should be sent to the Rox.Chat service. The type is String.

Parameter note - comment to the operator's evaluation, which should be sent to Rox.Chat service. Maximum length is 2000 characters. Type - optional String.

Parameter byRating - the operator's rating to be sent to Rox.Chat service. The rating must be an integer from 1 to 5 (if you specify otherwise, the method will not perform any actions). The type is Int.

The completionHandler parameter is a RateOperatorCallback object.

May throw errors like AccessError.

Warning!

Implementation of the mechanism of operator evaluation in chat is left to the developers of the mobile application!

Method respondSentryCall(String id)

This method can be used to transfer the chat to the operator on duty.

The id parameter is the ID of the message to transfer to the on-duty operator. The type is String.

May throw errors like AccessError.

Method searchMessages(String query, SearchMessagesCallback callback)

The method is used to search for a message in the history by query.

It may throw errors of AccessError type.

The query parameter is the query to search for. The type is String.

The callback parameter is an object that implements the SearchMessagesCallback protocol methods. The type is SearchMessagesCallback.

Method setPrechatFields(String prechatFields)

Sends additional fields to the server.

May throw errors like AccessError.

Parameter prechatFields - additional fields. The type is String.

Method setSurveyListener(SurveyListener surveyListener)

Use this method to set the SurveyListener object.

The surveyListener parameter is an object that implements the SurveyListener interface.

Method setGreetingMessageListener(GreetingMessageListener listener)

Use this method to set a greeting message.

The listener parameter is an object that implements the GreetingMessageListener interface.

Method send(String message, String data, DataMessageCallback dataMessageCallback)

The method is used to send a visitor's message to the Rox.Chat service.

The message parameter is the message to be sent. The type is String.

Maximum length of the message is 32000 characters. Longer messages will be cut off by the server when they are received.

The data parameter is used to send an arbitrary dictionary with message parameters to the server (if the server version supports this functionality). Dictionary keys must be of type String, values - of any "standard" type.

The dataMessageCallback parameter is a DataMessageCallback object or null.

Returns a randomly generated ID for this message, which can be used to identify this particular message within the application logic. Type is String.

Can throw errors of type AccessError.

If MessageTracker and MessageListener objects exist, sending a message will invoke the [added(newMessage, previousMessage)] method(android-sdk-handbook. md#added-message-new-message-after-previous-message) protocol MessageListener with a new message with status SENDING of enumerated type MessageSendStatus.

Method sendFiles(List<UploadedFile> uploadedFiles, SendFilesCallback sendFilesCallback)

A method to send uploaded files to the Rox.Chat server. The type is UploadedFile.

Parameter uploadedFiles - list of files to be sent.

Parameter sendFilesCallback - object that implements methods of the SendFilesCallback interface. The type is SendFilesCallback.

Method send(String surveyAnswer, SurveyAnswerCallback callback)

Use this method to send the answer to the current question received by the SurveyListener.on(nextQuestion, SurveyQuestion) method.

The surveyAnswer parameter is the answer, for a question of type 'stars', the answer will be an integer between 1 and 5 defining the operator's score. For a question of type 'radio', the answer is the index of the item in the options array starting from 1. For a question of type 'comment', the answer is a string representing the user's comment. The type is String.

May throw errors of type AccessError.

The callback parameter is an object that implements the SurveyAnswerCallback protocol methods. The type is SurveyAnswerCallback.

Method uploadFilesToServer(File file, String name, String mimeType, UploadFileToServerCallback uploadFileToServerCallback)

The file parameter is the file itself in File format.

The name parameter is the name of the file. The type is String.

Parameter mimeType - MIME-type of the transferred file. The type is String.

The uploadFileToServerCallback parameter is an object that implements the UploadFileToServerCallback protocol methods. The type is UploadFileToServerCallback.

Method deleteUploadedFiles(String fileGuid, DeleteUploadedFileCallback deleteUploadedFileCallback)

A method to delete files from the Rox.Chat server.

The fileGuid parameter is the id of the file to be deleted. The type is String.

The deleteUploadedFileCallback parameter is an object that implements the DeleteUploadedFileCallback protocol methods. The type is DeleteUploadedFileCallback.

Method sendSticker(int stickerId, SendStickerCallback sendStickerCallback)

Use this method to send a sticker to a chat room.

The stickerId parameter is the ID of the sticker to be sent to the Rox.Chat service. The type is int.

Parameter sendStickerCallback - object implementing the SendStickerCallback interface. The type is SendStickerCallback.

Method reactMessage(Message message, MessageReaction reaction, MessageReactionCallback callback)

The method is used to send the user's reaction to a message.

It may throw errors like AccessError.

The message parameter is the message to respond to. The type is Message.

The reaction parameter is the user's reaction. The type is MessageReaction.

The callback parameter is an object that implements the MessageReactionCallback protocol methods. The type is MessageReactionCallback.

Method updateWidgetStatus(String data)

The method is used to update widget status.

It may throw errors like AccessError.

Parameter data - string in JSON format with new widget status. The type is String.

Method closeSurvey(SurveyCloseCallback callback)

Use this method to close a survey.

It may throw errors like AccessError.

The completionHandler parameter is an object that implements the SurveyCloseCallback protocol methods. The type is optional.

Method clearChatHistory()

The method is called when the user clears the history.


Protocol Operator

Method getInfo()

Method allows you to get additional information about a particular operator.

Returns additional information about a particular operator. The type is optional String.


Protocol SendFilesCallback

A protocol-object can be passed in the callback parameter of the send(uploadedFiles, callback) method of the MessageStream protocol.

Method onSuccess(Message.Id messageId)

The method is called when files are successfully sent using the send(uploadedFiles:completionHandler:) method of the MessageStream protocol.

The messageid parameter is the ID of the corresponding message. The type is Message.Id.

Method onFailure(Message.Id messageId, SendFileError sendFilesError)

Called when sending files fails using the send(uploadedFiles, callback) method of the MessageStream protocol.

The messageid parameter is the ID of the corresponding message. The type is String.

Parameter sendFilesError - the error that prevented successful sending of the file. Type - SendFilesError.


Enumerated type SendFilesError

Possible errors that can be passed to the error parameter of the onFailure(messageID, sendFilesError) method of the SendFilesCallback protocol.

Case CONNECTION_TIMEOUT

The connection timeout time has been exceeded.

Case FILE_NOT_FOUND

File not found.

Case FILE_TYPE_NOT_ALLOWED

The file type is not resolved.

Case FILE_SIZE_EXCEEDED

The allowed file size has been exceeded.

Case FILE_SIZE_TOO_SMALL

The file being sent is too small.

Case MAX_FILES_COUNT_PER_CHAT_EXCEEDED

Maximum number of files for chat.

Case MAX_FILES_COUNT_PER_MESSAGE

Maximum number of files for a message.

Case UPLOADED_FILE_NOT_FOUND

Sending files in the request body is not supported.

Case FILE_NAME_INCORRECT

Incorrect file name.

Case FILE_IS_EMPTY

The file is empty.

Case UNAUTHORIZED

Visitor authentication error on the server.

Case UNKNOWN

Unknown error.


Protocol DeleteUploadedFileCallback

An object obeying the protocol can be passed in the callback parameter of the deleteUploadedFiles(fileGuid, completionHandler) protocol MessageStream method.

Method onSuccess()

The method is called when a file is successfully deleted using the deleteUploadedFiles(fileGuid, callback) protocol MessageStream method.

Method onFailure(DeleteUploadedFileError error)

Called when file deletion fails using the deleteUploadedFiles(fileGuid, callback) protocol MessageStream method.

The error parameter is the error that prevented the file from being sent successfully. Type - DeleteUploadedFileError.


Enumerated type DeleteUploadedFileError

Possible errors that can be passed to the error parameter of the onFailure(error) method of the DeleteUploadedFileCallback protocol.

Case FILE_NOT_FOUND

File not found.

Case FILE_HAS_BEEN_SENT

The file has been sent.

Case UNKNOWN

Unknown error.


Protocol SendStickerCallback

A protocol-object can be passed in the callback parameter of the send(message, callback) method of the MessageStream protocol.

Method onSuccess()

The method is called when a sticker is successfully sent using the sendSticker(withId, callback) protocol MessageStream method.

Method onFailure(error:)

Called when sending a sticker fails using the sendSticker(withId, callback) method of the MessageStream protocol.

The error parameter is the error that prevented the file from being sent successfully. Type - SendStickerError.


Enumerated type SendStickerError

Possible errors that can be passed to the error parameter of the onFailure(error:) method of the SendStickerCallback protocol.

Case NO_CHAT

No chat found.

Case NO_STICKER_ID

No sticker ID has been set.


Interface Survey

Method getConfig()

Use this method to get the configuration of the survey.

Does not accept parameters.

Returns an instance of the Config class.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getCurrentQuestionInfo()

Use this method to get information about the current question.

Does not accept any parameters.

Returns an instance of the CurrentQuestionInfo class.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getId()

Use this method to get the id of a survey.

Does not take any parameters.

Returns the ID of the survey. Type String.

Does not throw exceptions.

Does not require any other methods to be called first.


Interface SurveyAnswerCallback

An object that implements the interface can be passed in the callback parameter of the sendSurveyAnswer(String surveyAnswer, SurveyAnswerCallback callback) protocol MessageStream method.

Method onSuccess()

The method is called on success of the sendSurveyAnswer(String surveyAnswer, SurveyAnswerCallback callback) method of the MessageStream protocol.

Does not accept parameters.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method onFailure(RoxError<SurveyAnswerError> RoxError)

The method is called when the sendSurveyAnswer(String surveyAnswer, SurveyAnswerCallback callback) method of the MessageStream protocol fails.

The RoxError parameter is the error that occurred. The type is RoxError.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called first.


Interface SurveyCloseCallback

An object that implements the interface can be passed in the callback parameter of the closeSurvey(SurveyCloseCallback callback) method of the MessageStream protocol.

Method onSuccess()

The method is called when the closeSurvey(SurveyCloseCallback callback callback) method of the MessageStream protocol succeeds.

Does not accept parameters.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method onFailure(RoxError<SurveyAnswerError> RoxError)

The method is called when the method [closeSurvey(SurveyCloseCallback callback)](#close-survey) of the MessageStream protocol fails.

The RoxError parameter is the error that occurred. The type is RoxError<SurveyCloseError>.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called first.


Interface SurveyListener

An object that implements the interface can be passed in the SurveyListener parameter of the setSurveyListener(SurveyListener surveyListener) method of the MessageStream protocol.

Method onSurvey(Survey survey survey)

This method is called when a new survey comes from the server.

The survey parameter is the survey object.

It does not return anything.

Throws no exceptions.

Does not require any other methods to be called beforehand.

Method onNextQuestion(Survey.Question question)

This method is called in two cases: when a survey is received immediately after calling onSurvey(Survey survey survey), and when a previous question is successfully answered.

The question parameter is the current question.

It does not return anything.

Throws no exceptions.

Does not require any other methods to be called beforehand.

Method onSurveyCanceled()

This method is called when the survey is closed on the server.

Does not accept any parameters.

Does not return anything.

Does not throw any exceptions.

Does not require any other methods to be called first.


Interface UploadedFile

The interface is an abstraction representing a single file that is uploaded to the Rox.Chat server.

The interface is implemented by internal SDK entities, whose objects can be retrieved in method calls to the MessageListener interface.

The UploadedFile objects are immutable. Changes to any of its fields create a new object.

Method getSize()

A method that can be used to get the size of an attachment file.

Takes no parameters.

Returns the size of the attachment file in bytes. The type is long.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getGuid()

A method that can be used to get the guid of an attachment file.

Does not take any parameters.

Returns the value in text form. The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getFileName()

A method that can be used to get the name of an attachment file.

Does not take any parameters.

Returns the name of the attachment file in text form. The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getContentType()

A method that can be used to get the MIME type of an attachment.

Takes no parameters.

Returns the MIME type of the attachment in text form. The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getVisitorId()

A method that can be used to get the id of the file sender.

Does not take any parameters.

Returns the value in text form. The type is String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getClientContentType()

A method that can be used to get the MIME type of an attachment.

Takes no parameters.

Returns the MIME type of the attachment in text form. The type is String.

Does not throw exceptions.

Does not require any other methods to be called first.


Interface UploadFileToServerCallback

An interface whose methods are implemented by some application class.

An object subject to the interface can be passed in the uploadFileToServerCallback parameter of the uploadFilesToServer(File file, String name, String mimeType, UploadFileToServerCallback uploadFileToServerCallback) method of the MessageStream interface.

Method onSuccess(Message.Id id id, UploadedFile uploadedFile)

The method is called when a file is successfully uploaded using the uploadFilesToServer(File file file, String name, String mimeType, UploadFileToServerCallback uploadFileToServerCallback) method of the MessageStream interface.

The id parameter is the ID of the corresponding message. The type is Message.Id.

The uploadedFile parameter is the file uploaded to the server. The type is UploadedFile.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

The method will be called after the uploadFilesToServer(File file file, String name, String mimeType, UploadFileToServerCallback uploadFileToServerCallback) method completes.

Method onFailure(Message.Id id id, RoxError<SendFilesCallback.SendFileError> error)

Called when sending a file fails using the uploadFilesToServer(File file, String name, String mimeType, UploadFileToServerCallback uploadFileToServerCallback) method of the MessageStream interface.

The id parameter is the ID of the corresponding message. The type is Message.Id.

The error parameter - the error that prevented successful sending of the file. The type is <SendFilesCallback.SendFileError>.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

The method will be called after the uploadFilesToServer(File file file, String name, String mimeType, UploadFileToServerCallback uploadFileToServerCallback) method completes.


Enumerated type SurveyAnswerError

Possible errors that can be passed to the RoxError parameter of the onFailure(RoxError<SurveyAnswerError> RoxError) protocol SurveyAnswerCallback method.

Case INCORRECT_RADIO_VALUE

Occurs when an invalid answer to a question of type 'radio' was passed.

Case INCORRECT_STARS_VALUE

Occurs when an invalid answer was passed to a question of type 'stars'.

Case INCORRECT_SURVEY_ID

Occurs when an invalid survey ID was passed when attempting to submit a response to a question.

Case MAX_COMMENT_LENGTH_EXCEEDED

Occurs when an answer to a comment' type question was submitted that exceeds the maximum allowed length.

Case NO_CURRENT_SURVEY

Occurs when attempting to submit a response to a question when the current poll on the server has already been closed or has not yet been started.

Case SURVEY_DISABLED

Occurs when attempting to submit an answer to a question when the polling option is disabled on this server.

Case UNKOWN

Occurs when the error received cannot be handled by the current version of RoxClientLibrary.


Enumerated type SurveyCloseError

Possible errors that can be passed to the RoxError parameter of the onFailure(RoxError<SurveyCloseError> RoxError) protocol SurveyCloseCallback method.

Case INCORRECT_SURVEY_ID

Occurs when an invalid survey ID was passed in when trying to close a survey.

Case NO_CURRENT_SURVEY

Occurs when attempting to close a survey when the current survey on the server has already been closed or has not yet been started.

Case SURVEY_DISABLED

Occurs when trying to close a poll when the polling option is disabled on this server.

Case UNKNOWN

Occurs when the error received cannot be handled by the current version of RoxClientLibrary.


Interface GreetingMessageListener

The interface is an abstraction representing a greeting message.

An object implementing the interface can be passed in the listener parameter of the setGreetingMessageListener(GreetingMessageListener listener) method of the MessageStream protocol.

Method greetingMessage(String message)

The method is called when a greeting message is received before chat messages are received.

The message parameter is the greeting message. The type is String.

Does not return anything.

Does not throw exceptions.

Does not require any other methods to be called beforehand.


Interface Question

Method getType()

Use this method to get the type of the given question.

Does not accept parameters.

Returns the type of the question. Type Type.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getText()

Use this method to get the text of a question.

Does not accept parameters.

Returns the text of the question. Type String.

Does not throw exceptions.

Does not require any other methods to be called beforehand.

Method getOptions()

Use this method to get answer options for a question.

Does not accept parameters.

Returns a list of options of type List<String> or null if the question type is not 'radio'.

Does not throw exceptions.

Does not require any other methods to be called beforehand.