Delen via


SmsDevice.FromIdAsync(String) Method

Definition

Creates an instance of SmsDevice for the device that received the SMS message.

public:
 static IAsyncOperation<SmsDevice ^> ^ FromIdAsync(Platform::String ^ deviceId);
/// [Windows.Foundation.Metadata.Deprecated("ISmsDeviceStatics may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Devices.Sms.LegacySmsApiContract)]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<SmsDevice> FromIdAsync(winrt::hstring const& deviceId);
/// [Windows.Foundation.Metadata.RemoteAsync]
/// [Windows.Foundation.Metadata.Deprecated("ISmsDeviceStatics may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Devices.Sms.LegacySmsApiContract")]
 static IAsyncOperation<SmsDevice> FromIdAsync(winrt::hstring const& deviceId);
[Windows.Foundation.Metadata.Deprecated("ISmsDeviceStatics may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Devices.Sms.LegacySmsApiContract))]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<SmsDevice> FromIdAsync(string deviceId);
[Windows.Foundation.Metadata.RemoteAsync]
[Windows.Foundation.Metadata.Deprecated("ISmsDeviceStatics may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Devices.Sms.LegacySmsApiContract")]
public static IAsyncOperation<SmsDevice> FromIdAsync(string deviceId);
function fromIdAsync(deviceId)
Public Shared Function FromIdAsync (deviceId As String) As IAsyncOperation(Of SmsDevice)

Parameters

deviceId
String

Platform::String

winrt::hstring

A string representation of the DeviceInformation ID of the SMS device that received the SMS message.

Returns

The SMS device operation object.

Attributes

Windows requirements

App capabilities
cellularMessaging sms

Remarks

The SmsReceivedEventDetails interface handles the details of a received message; you can pass the DeviceInformation ID from that interface to this method to activate the device and retrieve additional message details, such as the sender and the body of the message. Because the device might be busy, the operation executes asynchronously. The asynchronous operation object returns immediately.

Applies to