Share via


SmsTextMessage2 Class

Definition

Encapsulates a decoded SMS text message. Prefer this class to the older SmsTextMessage class.

Note

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

To send a text message, construct an instance of this class, set all appropriate fields, and send using SmsDevice2.SendMessageAndGetResultAsync.

To access a received text message, create a background task that is triggered by the SmsMessageReceived event. In that task, first use SmsMessageReceivedTriggerDetails.MessageType to determine that the message is a text message, then use the SmsMessageReceivedTriggerDetails.TextMessage property to access the instance of this class.

public ref class SmsTextMessage2 sealed
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class SmsTextMessage2 final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class SmsTextMessage2 final
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class SmsTextMessage2
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class SmsTextMessage2
function SmsTextMessage2()
Public NotInheritable Class SmsTextMessage2
Inheritance
Object Platform::Object IInspectable SmsTextMessage2
Attributes
Implements

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)
App capabilities
cellularMessaging sms

Constructors

SmsTextMessage2()

Constructs a new, default instance of this class.

Properties

Body

Gets or sets the body of the text message.

CallbackNumber

Gets or sets the callback number for the message.

CellularClass

Gets the cellular class of the message.

DeviceId

Gets the device identifier for the device associated with the SMS text message.

Encoding

Gets or sets the encoding scheme used for the message.

From

gets the phone number of the sender of the message.

IsDeliveryNotificationEnabled

Gets or sets whether text message delivery notification is enabled for this message.

MessageClass

Gets the message class of the message.

MessageType

Gets the message type of the message.

ProtocolId

Gets the protocol identifier for the message.

RetryAttemptCount

Gets or sets the number of retry attempts for the message.

SimIccId

Gets the ICCID (Integrated Circuit Card Identifier) of the SIM that received the message.

TeleserviceId

Gets the teleservice identifier associated with this message.

Timestamp

The timestamp of this message.

To

Gets or sets the recipient phone number for the message.

Applies to

See also