MessagingProviderHelper
Helper class that provides all common functionality that is needed by messaging providers.
For example a messaging provider service can be initialized like this:
class StockSmsService(
iviServiceHostContext: IviServiceHostContext,
serviceIdProvider: IviDiscoverableServiceIdProvider
) : MessagingProviderServiceBase(iviServiceHostContext, serviceIdProvider) {
// ...
private val messagingProviderHelper = MessagingProviderHelper().also {
conversationsForProvider = it.conversations
messageTypesForProvider = it.messageTypes
it.registerSendMessageCallback { conversation, message ->
sendMessage(conversation, message)
}
}
// ...
}
Constructors
Properties
Functions
Adds or updates the specified conversations.
Adds or updates all the specified messages.
Adds or updates the specified conversation. Note that Conversation.unreadMessages will be ignored. Messages can only be added by using addOrUpdateMessage.
Adds or updates the specified message.
Finds a conversation originating from the source that has the specified contacts and the specified messageType. If source is null
, the source field is ignored.
Finds the message with the specified messageId in all conversations.
Finds a conversation originating from the source that has the specified contacts and the specified messageType. Otherwise, creates and adds a new conversation with the specified parameters.
Marks all messages up to and including the message with the specified messageId as read for the conversation with the specified conversationId.
Registers the specified callback to be called when a message is added with the MessageState.OUTGOING_QUEUED state. This will replace a previously registered callback.
Removes all messages with specified messageIds from the conversation with the specified conversationId.
Removes the conversation with the specified conversationId.
Retains only the conversations with the specified conversationIds. Removes the remaining conversations.
Retains only the messages with the specified messageIds. Removes the remaining messages.
Enables or disables the specified messageType according to the specified enabled parameter.