ChatMessageManager
ChatMessageManager
ChatMessageManager
ChatMessageManager
Class
Definition
Provides access to message transports and the message store. Also provides a method to display the UI to compose messages.
public : static class ChatMessageManagerpublic static class ChatMessageManagerPublic Static Class ChatMessageManager// You can use this class in JavaScript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Methods
GetTransportAsync(String) GetTransportAsync(String) GetTransportAsync(String) GetTransportAsync(String)
Asynchronously gets the@Windows.ApplicationModel.Chat.ChatMessageTransport?text=ChatMessageTransport.
public : static IAsyncOperation<ChatMessageTransport> GetTransportAsync(PlatForm::String transportId)public static IAsyncOperation<ChatMessageTransport> GetTransportAsync(String transportId)Public Static Function GetTransportAsync(transportId As String) As IAsyncOperation( Of ChatMessageTransport )// You can use this method in JavaScript.
- transportId
- PlatForm::String String String String
The locally unique identifier for the message transport.
GetTransportsAsync() GetTransportsAsync() GetTransportsAsync() GetTransportsAsync()
Asynchronously gets the chat message transports available on the device.
public : static IAsyncOperation<IVectorView<ChatMessageTransport>> GetTransportsAsync()public static IAsyncOperation<IReadOnlyList<ChatMessageTransport>> GetTransportsAsync()Public Static Function GetTransportsAsync() As IAsyncOperation( Of IReadOnlyListChatMessageTransport )// You can use this method in JavaScript.
An asynchronous operation that returns a list of transports on successful completion.
| Device family |
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
| Capabilities |
blockedChatMessages
|
RegisterTransportAsync() RegisterTransportAsync() RegisterTransportAsync() RegisterTransportAsync()
Asynchronously registers the app as a ChatMessageTransport in order to post messages to the ChatMessageStore.
public : static IAsyncOperation<PlatForm::String> RegisterTransportAsync()public static IAsyncOperation<string> RegisterTransportAsync()Public Static Function RegisterTransportAsync() As IAsyncOperation( Of string )// You can use this method in JavaScript.
The transport ID for the newly registered ChatMessageTransport.
RequestStoreAsync() RequestStoreAsync() RequestStoreAsync() RequestStoreAsync()
Returns the SMS messaging store for the phone.
public : static IAsyncOperation<ChatMessageStore> RequestStoreAsync()public static IAsyncOperation<ChatMessageStore> RequestStoreAsync()Public Static Function RequestStoreAsync() As IAsyncOperation( Of ChatMessageStore )// You can use this method in JavaScript.
An asynchronous operation that returns a ChatMessageStore on successful completion.
Remarks
This method returns an IReadOnlyList of ChatMessageStore class objects. The method is invoked as an IAsyncOperation as shown in the following example:
ChatMessageStore store = await ChatMessageManager.RequestStoreAsync();
RequestSyncManagerAsync() RequestSyncManagerAsync() RequestSyncManagerAsync() RequestSyncManagerAsync()
Gets the ChatSyncManager instance.
public : static IAsyncOperation<ChatSyncManager> RequestSyncManagerAsync()public static IAsyncOperation<ChatSyncManager> RequestSyncManagerAsync()Public Static Function RequestSyncManagerAsync() As IAsyncOperation( Of ChatSyncManager )// You can use this method in JavaScript.
When the asynchronous operation completes, a ChatSyncManager object is returned.
| Device family |
Windows 10 Anniversary Edition (introduced v10.0.14393.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v3)
|
ShowComposeSmsMessageAsync(ChatMessage) ShowComposeSmsMessageAsync(ChatMessage) ShowComposeSmsMessageAsync(ChatMessage) ShowComposeSmsMessageAsync(ChatMessage)
Shows the compose SMS dialog, pre-populated with data from the supplied ChatMessage object, allowing the user to send an SMS message.
public : static IAsyncAction ShowComposeSmsMessageAsync(ChatMessage message)public static IAsyncAction ShowComposeSmsMessageAsync(ChatMessage message)Public Static Function ShowComposeSmsMessageAsync(message As ChatMessage) As IAsyncAction// You can use this method in JavaScript.
- message
- ChatMessage ChatMessage ChatMessage ChatMessage
The chat message.
An asynchronous action.
Remarks
The TransportId property of the message is set to the desired outgoing transport. The ChatMessage.Body property is optionally set to any initial text. The following example shows a call to ShowComposeSmsMessageAsync with the transport and initial text for a message:
async void ComposeMessage()
{
ChatMessage message;
message.Body = "Sent from *SpiffyChat*: How’s your morning going?";
message.TransportId = "0";
message.Recipients.Add("+12065551234");
await ChatMessageManager.ShowComposeSmsMessageAsync(message);
}
ShowSmsSettings() ShowSmsSettings() ShowSmsSettings() ShowSmsSettings()
Launches the device's SMS settings app.
public : static void ShowSmsSettings()public static void ShowSmsSettings()Public Static Function ShowSmsSettings() As void// You can use this method in JavaScript.
Remarks
The ShowSmsSettings method allows a chat application to launch the SMS settings pane attached to the current UI thread.