SmsTextMessage class

Applies to Windows only

Manages a decoded SMS text message, providing direct access to the plain text body of the message, as well as key header properties, such as time stamp.

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.

Syntax


Public NotInheritable Class SmsTextMessage
    Implements ISmsTextMessage, _
    ISmsMessage

Attributes

[DualApiPartition()]
[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]

Members

The SmsTextMessage class has these types of members:

Constructors

The SmsTextMessage class has these constructors.

ConstructorDescription
SmsTextMessage Creates an instance of the SmsTextMessage class.

 

Methods

The SmsTextMessage class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
FromBinaryData Decodes a binary message and places the results in a new instance of a text message. This method represents the binary message as a reference to a buffer of bytes and a selection of how the buffer is encoded. Therefore, it can be used when the message did not originate directly from the device or as an instance of an SmsBinaryMessage class.
FromBinaryMessage Reads a binary message and decodes it. The results are placed in a new instance of a text message.
ToBinaryMessages Reads a message in the specified format and places the results in a new instance of a binary message.

 

Properties

The SmsTextMessage class has these properties.

PropertyAccess typeDescription

Body

Read/writeSpecifies the plain text body of the message.

Encoding

Read/writeSpecifies the encoding type that has been set to use when sending this message.

From

Read/writeSpecifies the phone number of the sender of the message.

Id

Read-onlyIndicates the ID of the SMS text message.

MessageClass

Read-onlySpecifies the message class of a message. This message class typically originates on the network, not the mobile device.

PartCount

Read-onlyIndicates the total number of parts in the original message if the message is part of a multi-part message.

PartNumber

Read-onlyIndicates the part number of a multi-part message if this message is part of a multi-part message. It can be used to reconstruct the original message by joining the parts together, in conjunction with the PartReferenceId and PartCount properties.

PartReferenceId

Read-onlyIndicates a reference value that can be used if the message is part of a multi-part message. If this message belongs to a multi-part message, the PartNumber value can be used to reconstruct the full original message, and each part of that message will have the same value for PartReferenceId.

Timestamp

Read-onlyIndicates the timestamp of the message. It is determined locally for a constructed message instance or from the service center timestamp of a received message.

To

Read/writeIndicates the recipient phone number of this message.

 

Requirements

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 [Windows Store apps, desktop apps]

Minimum supported phone

None supported

Namespace

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

Metadata

Windows.winmd

Capabilities

sms

 

 

Show:
© 2014 Microsoft