Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IMessageRepository

interface IMessageRepository
Extends com.amazon.apmf.IStandard Message repository. Refers to a MAS instance.

Methods

getSupportedFeatures()

MessageRepositoryFeature[] getSupportedFeatures()
Get the supported features of this message repository. Privilege: None ( IMessageRepository is retrieved with IMessageClient::getMessageRepositories() which requires the com.amazon.bluetooth.privilege.access privilege).

Returns

MessageRepositoryFeature[] Returns an array of MessageRepositoryFeature.

Throws


getSupportedMessageTypes()

MessageType[] getSupportedMessageTypes()
Get the supported message types of this message repository. Privilege: None ( IMessageRepository is retrieved with IMessageClient::getMessageRepositories() which requires the com.amazon.bluetooth.privilege.access privilege).

Returns

MessageType[] Returns an array of MessageType.

Throws


getName()

string getName()
Get the name of this message repository. Privilege: None ( IMessageRepository is retrieved with IMessageClient::getMessageRepositories() which requires the com.amazon.bluetooth.privilege.access privilege).

Returns

string Returns Message repository name string.

Throws


getDevice()

IDevice* getDevice()
Get the remote device of this message repository. Privilege: None ( IMessageRepository is retrieved with IMessageClient::getMessageRepositories() which requires the com.amazon.bluetooth.privilege.access privilege).

Returns

IDevice* Returns a pointer to IDevice.

Throws


addListener()

com.amazon.apmf.ISubscription* addListener(IMessageRepositoryListener* listener)
Add a listener for events from this message repository. Privilege: com.amazon.bluetooth.privilege.message_client

Parameters

listener
IMessageRepositoryListener* — Required IMessageRepositoryListener.

Returns

com.amazon.apmf.ISubscription* Returns a pointer to ISubscription.

Throws


connect()

void connect()
Connect to this message repository. All applications share connections to the same remote device message repository. Connection to message repository is required for all message operations. This is a blocking call until the connection with the remote device message repository is established. Privilege: com.amazon.bluetooth.privilege.access

Throws


disconnect()

void disconnect()
Disconnect from this message repository. All applications share connections to the same remote device message repository. Message operations fail when disconnected from message repository. This is a blocking call until the disconnection with the remote device message repository is complete. Privilege: com.amazon.bluetooth.privilege.access

Throws


isConnected()

bool isConnected()
Get message repository connection state. Indicates that the message repository is connected. This might be triggered by IMessageRepository::connect() from any application. Privilege: com.amazon.bluetooth.privilege.access

Returns

bool Returns true if message repository is connected, false otherwise.

makeMessageBuilder()

IMessageBuilder* makeMessageBuilder()
Make a message builder. This creates a new message that can be sent through the message repository.

Returns

IMessageBuilder* Returns pointer to IMessageBuilder.

Throws


sendMessage()

void sendMessage(IMessage* message, MessageSendSettings* settings)
Send a message to this message repository. This is a blocking call until message is received by the message repository (not when message is delivered to the intended recipients). Privilege: com.amazon.bluetooth.privilege.message_client

Parameters

message
IMessage* — Required Message to send, see IMessage.
settings
MessageSendSettings* — Required Send message settings, see MessageSendSettings.

Throws


makeListingFilterBuilder()

IMessageListingFilterBuilder* makeListingFilterBuilder()
Make a message listing filter builder. IMessageListingFilter is used with IMessageRepository::getMessageListing().

Returns

IMessageListingFilterBuilder* Returns pointer to IMessageListingFilterBuilder.

Throws


getMessageListing()

IMessageListing*[] getMessageListing(IMessageListingFilter* filter)
Get messages listing from this message repository. A message listing is a list of message summary details such as subject, sender, and date time, see IMessageListing for more details. This is a blocking call until message listing is received from the remote device message repository. Privilege: com.amazon.bluetooth.privilege.message_client

Parameters

filter
IMessageListingFilter* — Required IMessageListingFilter is used to process message listings.

Returns

IMessageListing*[] Returns an array of pointer to IMessageListing objects.

Throws


Last modified on October 29, 2026