Asynchronously submits a JSON message.
public:
IAsyncAction^ SubmitMessageAsync(
String^ message
)
message
Type: String
The message that you want to send, in JavaScript Object Notation (JSON).
The maximum size of the message is 65,532 bytes. Although strings use UTF-16 encoding in the console API, the messages are converted to UTF-8 encoding for transmission across the network. The size limit applies to the UTF-8 encoded format of the string.
Type: IAsyncAction
Returns an IAsyncAction object that represents the state of the asynchronous operation. Completion of the asynchronous operation is signaled by using a handler that is passed to the IAsyncAction.Completed property.
SubmitMessageAsync will throw a COMException if there are more than 8 messages pending for the current device. This can happen if the title tries to send messages too quickly (before the async operation has completed) and is a security feature of the API to prevent denial of service attacks.
To avoid hitting this condition, wait for the async operation returned by SubmitMessageAsync to complete before sending the next message.
If the JSON string that you specify includes newline (\n) characters, the following error occurs on Android devices and the Android browser does not display the message in the companion:
Uncaught SyntaxError: Unexpected token ILLEGAL
To avoid this error when you send a message to an Android device, replace the newline characters with spaces. For example, change L"{\n\t\"ingame\" : false\n}" to "{ \t\"ingame\" : false }".
Namespace: Windows.Xbox.SmartGlass
Metadata: windows.winmd