Alexa Auto SDK
4.3
|
Public Types | |
using | ErrorCode = MessagingEngineInterface::ErrorCode |
using | ConnectionState = MessagingEngineInterface::ConnectionState |
using | PermissionState = MessagingEngineInterface::PermissionState |
Public Member Functions | |
virtual void | sendMessage (const std::string &token, const std::string &message, const std::string &recipients)=0 |
virtual void | uploadConversations (const std::string &token)=0 |
virtual void | updateMessagesStatus (const std::string &token, const std::string &conversationId, const std::string &status)=0 |
void | sendMessageSucceeded (const std::string &token) |
void | sendMessageFailed (const std::string &token, ErrorCode code, const std::string &message="") |
void | conversationsReport (const std::string &token, const std::string &conversations) |
void | updateMessagesStatusSucceeded (const std::string &token) |
void | updateMessagesStatusFailed (const std::string &token, ErrorCode code, const std::string &message="") |
void | updateMessagingEndpointState (ConnectionState connectionState, PermissionState sendPermission, PermissionState readPermission) |
Messaging should be extended to allow a user to use Alexa to interact with a device that provides Short Messaging Service (SMS) capabilities, such as a connected mobile phone.
The platform implementation is responsible for uploading unread messages to the cloud when the messaging endpoint is connected, and when new messages are received. Alexa reads messages in the order they are uploaded. Additionally, the platform implementation is responsible for sending messages, updating message status, and providing the messaging endpoint connection state and permissions.
using aace::messaging::Messaging::ErrorCode = MessagingEngineInterface::ErrorCode |
Describes the ErrorCode
for failed responses.
using aace::messaging::Messaging::ConnectionState = MessagingEngineInterface::ConnectionState |
Describes the ConnectionState
of the messaging endpoint.
using aace::messaging::Messaging::PermissionState = MessagingEngineInterface::PermissionState |
Describes the PermissionState
of the messaging endpoint.
|
pure virtual |
Notifies the platform implementation to send an SMS message via the messaging endpoint. The message text contains a short lived URL that contains the audio data from which the message was generated.
[in] | token | The identifier for the request. |
[in] | message | The body of the message, which includes the text and a URL pointing to the audio the audio data from which the message was generated. The text and the URL are separated by a ' ' character. |
[in] | recipients | JSON data containing the recipients of the message. { "recipients" : [ { "address" : "{{STRING}}", "addressType" : "PhoneNumberAddress" } ] }
|
|
pure virtual |
Notifies the platform implementation to upload all unread messages to the cloud. This method is called if message playback is interrupted or when Alexa has finished reading all messages. This ensures that the cloud and the messaging endpoint stay in sync with the status of unread messages. Upload messages via the conversationsReport
API using the token received.
[in] | token | The identifier for the request. |
|
pure virtual |
Notifies the platform implementation that a message has been read, and therefore the messaging device must update the message status to reflect that. The platform implementation is responsible for maintaining the list of unread messages. It must send a response to the cloud via updateMessagesStatusSucceeded
or updateMessagesStatusFailed
depending on the result of the status update.
[in] | token | The identifier for the request. |
[in] | conversationId | The identifier for the conversation whose status will be updated. This is the value provided by the platform via the conversationsReport API. |
[in] | status | Contains the set of message identifiers that need to be updated to the associated status. { "statusMap" : { "read" : [{{STRING}}], } }
|
void aace::messaging::Messaging::sendMessageSucceeded | ( | const std::string & | token | ) |
Notifies the cloud that the sendMessage
request succeeded.
[in] | token | The token received from the sendMessage request. |
void aace::messaging::Messaging::sendMessageFailed | ( | const std::string & | token, |
ErrorCode | code, | ||
const std::string & | message = "" |
||
) |
Notifies the cloud that the sendMessage
request failed.
[in] | token | The token received from the sendMessage request. |
[in] | code | The error code describing the reason for the failure. |
[in] | message | Optional error message describing the failure. |
void aace::messaging::Messaging::conversationsReport | ( | const std::string & | token, |
const std::string & | conversations | ||
) |
Updates the cloud with the list of unread messages that Alexa will play back. Call this method when the messaging endpoint is connected and read permission has been granted. Additionally, use this method to reply to a uploadConversations
request, passing back the token that was sent in that request.
[]
.The list of conversations is a JSON array. Each conversation must contain a unique identifier that will be used by the updateMessagesStatus
request to identify the conversation whose messages must be updated.
The "otherParticipants" field of the conversation report contains the phone numbers of all participants in the conversation, except for the phone number of the messaging endpoint.
[in] | The | token received from uploadConversations , otherwise an empty string. |
[in] | conversations | A JSON array representing the unread messages of the messaging endpoint. [ { "id": "{{STRING}}", "otherParticipants": [ { "address":"{{STRING}}", "addressType":"PhoneNumberAddress" } ], "messages": [ { "id":"{{STRING}}", "payload": { "@type":"text", "text":"{{STRING}}" }, "status":"unread", "createdTime":"{{STRING}}", "sender": { "address":"{{STRING}}", "addressType":"PhoneNumberAddress" } } ], "unreadMessageCount": {{INTEGER}} } ]
|
void aace::messaging::Messaging::updateMessagesStatusSucceeded | ( | const std::string & | token | ) |
Notifies the cloud that the updateMessagesStatus
request succeeded.
[in] | token | The token received from the |
void aace::messaging::Messaging::updateMessagesStatusFailed | ( | const std::string & | token, |
ErrorCode | code, | ||
const std::string & | message = "" |
||
) |
Notifies the cloud that the updateMessagesStatus
request failed.
[in] | token | The token received from the |
[in] | code | The error code describing the reason for the failure. |
[in] | message | Optional error message describing the failure. |
void aace::messaging::Messaging::updateMessagingEndpointState | ( | ConnectionState | connectionState, |
PermissionState | sendPermission, | ||
PermissionState | readPermission | ||
) |
Allows the platform implementation to provide the connection state of the messaging endpoint, and whether send and read permissions are granted by the user.
[in] | connectionState | CONNECTED If the messaging endpoint is connected, else DISCONNECTED |
[in] | sendPermission | ON If the messaging endpoint can send messages, else OFF |
[in] | readPermission | ON If the messaging endpoint messages be read, else OFF |
Alexa Auto SDK 4.3 - Copyright 2017-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0