| java.lang.Object | ||
| ↳ | com.gsma.services.rcs.RcsService | |
| ↳ | com.gsma.services.rcs.chat.ChatService | |
Chat service offers the main entry point to initiate chat 1-1 and group conversations with contacts. Several applications may connect/disconnect to the API. The parameter contact in the API supports the following formats: MSISDN in national or international format, SIP address, SIP-URI or Tel-URI.
|
[Expand]
Inherited Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.gsma.services.rcs.RcsService
| |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
ChatService(Context ctx, RcsServiceListener listener)
Constructor
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| void |
addEventListener(GroupChatListener listener)
Adds a listener on group chat events
| ||||||||||
| void |
addEventListener(OneToOneChatListener listener)
Adds a listener for one-to-one chat events
| ||||||||||
| void |
clearMessageDeliveryExpiration(Set<String> msgIds)
Disables and clears any delivery expiration for a set of chat messages regardless if the
delivery of them has expired already or not.
| ||||||||||
| final void |
connect()
Connects to the API
| ||||||||||
| void |
deleteGroupChat(String chatId)
Delete a group chat by its chat id from history and abort/reject any associated ongoing
session if such exists.
| ||||||||||
| void |
deleteGroupChats()
Deletes all group chat from history and abort/reject any associated ongoing session if such
exists.
| ||||||||||
| void |
deleteMessage(String msgId)
Delete a message from its message id from history.
| ||||||||||
| void |
deleteOneToOneChat(ContactId contact)
Deletes a one to one chat with a given contact from history and abort/reject any associated
ongoing session if such exists.
| ||||||||||
| void |
deleteOneToOneChats()
Deletes all one to one chat from history and abort/reject any associated ongoing session if
such exists.
| ||||||||||
| void |
disconnect()
Disconnects from the API
| ||||||||||
| ChatMessage |
getChatMessage(String msgId)
Returns a chat message from its unique ID
| ||||||||||
| ChatServiceConfiguration |
getConfiguration()
Returns the configuration of the chat service
| ||||||||||
| GroupChat |
getGroupChat(String chatId)
Returns a group chat from its unique ID.
| ||||||||||
| OneToOneChat |
getOneToOneChat(ContactId contact)
Returns a chat with a given contact
| ||||||||||
| GroupChat |
initiateGroupChat(Set<ContactId> contacts, String subject)
Initiates a group chat with a group of contact and returns a GroupChat instance.
| ||||||||||
| boolean |
isAllowedToInitiateGroupChat()
Returns true if it is possible to initiate a new group chat now else returns false.
| ||||||||||
| boolean |
isAllowedToInitiateGroupChat(ContactId contact)
Returns true if it's possible to initiate a new group chat with the specified contactId right
now, else returns false.
| ||||||||||
| void |
markMessageAsRead(String msgId)
Mark a received message as read (ie.
| ||||||||||
| void |
removeEventListener(OneToOneChatListener listener)
Removes a listener for one-to-one chat events
| ||||||||||
| void |
removeEventListener(GroupChatListener listener)
Removes a listener on group chat events
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.gsma.services.rcs.RcsService
| |||||||||||
From class
java.lang.Object
| |||||||||||
Constructor
| ctx | Application context |
|---|---|
| listener | Service listener |
Adds a listener on group chat events
| listener | Group chat listener |
|---|
| RcsServiceNotAvailableException | |
| RcsGenericException | |
| RcsServiceNotAvailableException |
Adds a listener for one-to-one chat events
| listener | One-to-one chat listener |
|---|
| RcsServiceNotAvailableException | |
| RcsGenericException | |
| RcsServiceNotAvailableException |
Disables and clears any delivery expiration for a set of chat messages regardless if the delivery of them has expired already or not.
| msgIds | the message IDs |
|---|
| RcsServiceNotAvailableException | |
| RcsPersistentStorageException | |
| RcsGenericException | |
| RcsPersistentStorageException | |
| RcsServiceNotAvailableException |
Connects to the API
| RcsPermissionDeniedException |
|---|
Delete a group chat by its chat id from history and abort/reject any associated ongoing session if such exists.
| chatId | the chat ID |
|---|
| RcsServiceNotAvailableException | |
| RcsGenericException | |
| RcsServiceNotAvailableException |
Deletes all group chat from history and abort/reject any associated ongoing session if such exists.
| RcsServiceNotAvailableException | |
| RcsGenericException | |
| RcsServiceNotAvailableException |
Delete a message from its message id from history.
| msgId | the message ID |
|---|
| RcsServiceNotAvailableException | |
| RcsGenericException | |
| RcsServiceNotAvailableException |
Deletes a one to one chat with a given contact from history and abort/reject any associated ongoing session if such exists.
| contact | the remote contact |
|---|
| RcsServiceNotAvailableException | |
| RcsGenericException | |
| RcsServiceNotAvailableException |
Deletes all one to one chat from history and abort/reject any associated ongoing session if such exists.
| RcsServiceNotAvailableException | |
| RcsGenericException | |
| RcsServiceNotAvailableException |
Returns a chat message from its unique ID
| msgId | Message id |
|---|
| RcsServiceNotAvailableException | |
| RcsGenericException | |
| RcsServiceNotAvailableException |
Returns the configuration of the chat service
| RcsServiceNotAvailableException | |
| RcsGenericException | |
| RcsServiceNotAvailableException |
Returns a group chat from its unique ID. An exception is thrown if the chat ID does not exist
| chatId | Chat ID |
|---|
| RcsServiceNotAvailableException | |
| RcsGenericException | |
| RcsServiceNotAvailableException |
Returns a chat with a given contact
| contact | ContactId |
|---|
| RcsServiceNotAvailableException | |
| RcsGenericException | |
| RcsServiceNotAvailableException |
Initiates a group chat with a group of contact and returns a GroupChat instance. The subject is optional and may be null.
| contacts | Set of contact identifiers |
|---|---|
| subject | The subject is optional and may be null |
| RcsPermissionDeniedException | |
| RcsServiceNotRegisteredException | |
| RcsMaxAllowedSessionLimitReachedException | |
| RcsPersistentStorageException | |
| RcsServiceNotAvailableException | |
| RcsGenericException | |
| RcsMaxAllowedSessionLimitReachedException | |
| RcsPermissionDeniedException | |
| RcsPersistentStorageException | |
| RcsServiceNotAvailableException | |
| RcsServiceNotRegisteredException |
Returns true if it is possible to initiate a new group chat now else returns false.
| RcsServiceNotAvailableException | |
| RcsGenericException | |
| RcsServiceNotAvailableException |
Returns true if it's possible to initiate a new group chat with the specified contactId right now, else returns false.
| contact | the remote contact |
|---|
| RcsPersistentStorageException | |
| RcsServiceNotAvailableException | |
| RcsGenericException | |
| RcsPersistentStorageException | |
| RcsServiceNotAvailableException |
Mark a received message as read (ie. displayed in the UI)
| msgId | Message id |
|---|
| RcsServiceNotAvailableException | |
| RcsPersistentStorageException | |
| RcsGenericException | |
| RcsPersistentStorageException | |
| RcsServiceNotAvailableException |
Removes a listener for one-to-one chat events
| listener | One-to-one chat listener |
|---|
| RcsServiceNotAvailableException | |
| RcsGenericException | |
| RcsServiceNotAvailableException |
Removes a listener on group chat events
| listener | Group chat event listener |
|---|
| RcsServiceNotAvailableException | |
| RcsGenericException | |
| RcsServiceNotAvailableException |