SmsTextMessage2 SmsTextMessage2 SmsTextMessage2 SmsTextMessage2 Class

Definition

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

Note

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

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 : sealed class SmsTextMessage2 : ISmsMessageBase, ISmsTextMessage2public sealed class SmsTextMessage2 : ISmsMessageBase, ISmsTextMessage2Public NotInheritable Class SmsTextMessage2 Implements ISmsMessageBase, ISmsTextMessage2// You can use this class in JavaScript.
Attributes
Windows 10 requirements
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
cellularMessaging

Constructors

SmsTextMessage2() SmsTextMessage2() SmsTextMessage2() SmsTextMessage2()

Constructs a new, default instance of this class.

public : SmsTextMessage2()public SmsTextMessage2()Public Sub New()// You can use this method in JavaScript.
Additional features and requirements
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
cellularMessaging

Properties

Body Body Body Body

Gets or sets the body of the text message.

public : PlatForm::String Body { get; set; }public string Body { get; set; }Public ReadWrite Property Body As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The plain text body of the message, as a string.

Additional features and requirements
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
cellularMessaging

CallbackNumber CallbackNumber CallbackNumber CallbackNumber

Gets or sets the callback number for the message.

public : PlatForm::String CallbackNumber { get; set; }public string CallbackNumber { get; set; }Public ReadWrite Property CallbackNumber As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The callback number as a string.

Additional features and requirements
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
cellularMessaging

CellularClass CellularClass CellularClass CellularClass

Gets the cellular class of the message.

public : CellularClass CellularClass { get; }public CellularClass CellularClass { get; }Public ReadOnly Property CellularClass As CellularClass// You can use this property in JavaScript.
Value
CellularClass CellularClass CellularClass CellularClass

An enumeration value specifying the cellular class of the message (GSM or CDMA).

Additional features and requirements
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
cellularMessaging

DeviceId DeviceId DeviceId DeviceId

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

public : PlatForm::String DeviceId { get; }public string DeviceId { get; }Public ReadOnly Property DeviceId As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The device identifier.

Additional features and requirements
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
cellularMessaging

Encoding Encoding Encoding Encoding

Gets or sets the encoding scheme used for the message.

public : SmsEncoding Encoding { get; set; }public SmsEncoding Encoding { get; set; }Public ReadWrite Property Encoding As SmsEncoding// You can use this property in JavaScript.
Value
SmsEncoding SmsEncoding SmsEncoding SmsEncoding

An enumeration value specifying the encoding scheme used in a received message, or the scheme to be used in a message that will be sent.

Additional features and requirements
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
cellularMessaging

From From From From

gets the phone number of the sender of the message.

public : PlatForm::String From { get; }public string From { get; }Public ReadOnly Property From As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The sender's phone number, as a string.

Additional features and requirements
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
cellularMessaging

IsDeliveryNotificationEnabled IsDeliveryNotificationEnabled IsDeliveryNotificationEnabled IsDeliveryNotificationEnabled

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

public : PlatForm::Boolean IsDeliveryNotificationEnabled { get; set; }public bool IsDeliveryNotificationEnabled { get; set; }Public ReadWrite Property IsDeliveryNotificationEnabled As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

True indicates that text message delivery notification is enabled. False indicates no notification.

Additional features and requirements
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
cellularMessaging

MessageClass MessageClass MessageClass MessageClass

Gets the message class of the message.

public : SmsMessageClass MessageClass { get; }public SmsMessageClass MessageClass { get; }Public ReadOnly Property MessageClass As SmsMessageClass// You can use this property in JavaScript.
Value
SmsMessageClass SmsMessageClass SmsMessageClass SmsMessageClass

An enumeration value, set according to the network, for the message class of the message.

Additional features and requirements
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
cellularMessaging

MessageType MessageType MessageType MessageType

Gets the message type of the message.

public : SmsMessageType MessageType { get; }public SmsMessageType MessageType { get; }Public ReadOnly Property MessageType As SmsMessageType// You can use this property in JavaScript.
Value
SmsMessageType SmsMessageType SmsMessageType SmsMessageType

An enumeration value indicating the message type.

Additional features and requirements
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
cellularMessaging

ProtocolId ProtocolId ProtocolId ProtocolId

Gets the protocol identifier for the message.

public : int ProtocolId { get; }public int ProtocolId { get; }Public ReadOnly Property ProtocolId As int// You can use this property in JavaScript.
Value
int int int int

Gets an integer which identifies the protocol.

Additional features and requirements
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
cellularMessaging

RetryAttemptCount RetryAttemptCount RetryAttemptCount RetryAttemptCount

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

public : int RetryAttemptCount { get; set; }public int RetryAttemptCount { get; set; }Public ReadWrite Property RetryAttemptCount As int// You can use this property in JavaScript.
Value
int int int int

The number of retry attempts to be attempted for a sent message, or that were required to send a received message.

Additional features and requirements
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
cellularMessaging

SimIccId SimIccId SimIccId SimIccId

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

public : PlatForm::String SimIccId { get; }public string SimIccId { get; }Public ReadOnly Property SimIccId As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The ICCID of the SIM.

Additional features and requirements
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
cellularMessaging

TeleserviceId TeleserviceId TeleserviceId TeleserviceId

Gets the teleservice identifier associated with this message.

public : int TeleserviceId { get; }public int TeleserviceId { get; }Public ReadOnly Property TeleserviceId As int// You can use this property in JavaScript.
Value
int int int int

The teleservice identifier.

Additional features and requirements
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
cellularMessaging

Timestamp Timestamp Timestamp Timestamp

The timestamp of this message.

public : DateTime Timestamp { get; }public DateTimeOffset Timestamp { get; }Public ReadOnly Property Timestamp As DateTimeOffset// You can use this property in JavaScript.
Value
DateTime DateTimeOffset DateTimeOffset DateTimeOffset

The timestamp. Based on local time for a constructed message, or on the service center timestamp for a received message.

Additional features and requirements
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
cellularMessaging

To To To To

Gets or sets the recipient phone number for the message.

public : PlatForm::String To { get; set; }public string To { get; set; }Public ReadWrite Property To As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The destination phone number.

Additional features and requirements
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
cellularMessaging