MessagingProviderService

A discoverable service that provides support for one or more types of messaging.

All available messaging providers are aggregated by the MessagingService. Messaging providers should not directly be used by a frontend, the MessagingService should be used instead.

It is possible to extend messaging in TomTom Digital Cockpit by implementing a new messaging provider.

Note: There should always be a single messaging provider that supports a particular messaging type, as defined by the messageTypesForProvider map.

Messages are organized in conversations. All messages from the same contact, that are received through the same messaging provider, are part of a single conversation. If the conversation has unread messages, it will be visible through the conversationsForProvider map.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

All messaging conversations.

Link copied to clipboard

All the message types that the messaging provider handles. Every messaging provider can handle one or more MessageTypes. However, each MessageType should always be handled by only a single messaging provider in the system.

Functions

Link copied to clipboard
abstract suspend fun getMessage(messageId: Uid<Message>): Message?

Get the message with the specified messageId; returns null if that message is not available.

Link copied to clipboard
abstract suspend fun getOrCreateConversationId(conversationContacts: Set<ConversationContact>, messageType: MessageType, source: ConversationSource?): Uid<Conversation>?

Returns the ID of the conversation between the user and conversationContacts that contains messages of type messageType and originates from the source. If the conversation does not exist and the provider supports this, a new one is created and its corresponding ID is returned. Otherwise null is returned.

Link copied to clipboard
abstract suspend fun markConversationReadUpToAndIncluding(conversationId: Uid<Conversation>, messageId: Uid<Message>)

Mark the message with messageId, and all messages that were received before it in the same conversation, as read.

Link copied to clipboard
abstract suspend fun reply(reply: ConversationReply): Boolean

Replies with the specified ConversationReply to the conversation with the specified ConversationReply.id.

Link copied to clipboard
abstract suspend fun updateMessageState(messageId: Uid<Message>, newState: MessageState)

Updates the state of the message with the specified messageId to the specified newState.