Windows Dev Center

SmsDevice.FromIdAsync | fromIdAsync method

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

Note  This functionality is only available to mobile operator apps and Windows Store apps given privileged access by mobile network operators, mobile broadband adapter IHV, or OEM. For more information, see Mobile Broadband: Windows Store device apps.

Note  Note that this class and its methods are supported for the maintenance of legacy desktop apps that used it in earlier versions of Windows; and if you do use this class, you must specify the Windows.Devices.Sms.LegacySmsApiContract in your app's manifest. Do not use this class if you are developing new apps for Windows 10. Instead, use the members of this namespace that do not require the Windows.Devices.Sms.LegacySmsApiContract.

Syntax


Windows.Devices.Sms.SmsDevice.fromIdAsync(deviceId).done( /* Your success and error handlers */ );

Parameters

deviceId

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

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

Return value

Type: IAsyncOperation<SmsDevice>

The SMS device operation object.

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.

The first use of the SmsDevice object to call FromIdAsync by applications written in C# or C++ should be on the single-threaded apartment (STA) thread. Calls from a multi-threaded apartment (MTA) thread may result in undefined behavior.

Requirements (Windows 10 device family)

Device family

Desktop

API contract

Windows.Devices.Sms.LegacySmsApiContract, introduced version 1.0

Namespace

Windows.Devices.Sms
Windows::Devices::Sms [C++]

Metadata

Windows.Devices.Sms.LegacySmsApiContract.winmd

Capabilities

sms

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported

Namespace

Windows.Devices.Sms
Windows::Devices::Sms [C++]

Metadata

Windows.winmd

Capabilities

sms

Attributes

[Deprecated()]

See also

SmsDevice

 

 

Show:
© 2015 Microsoft