ISmsTextMessage ISmsTextMessage ISmsTextMessage ISmsTextMessage Interface

This interface manipulates a decoded SMS text message. It provides 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 app given privileged access by mobile network operators, mobile broadband adapter IHV, or OEM. For more information, see Mobile Broadband: 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

Declaration

public interface ISmsTextMessagepublic interface ISmsTextMessagePublic Interface ISmsTextMessagepublic interface ISmsTextMessage

Inheritance Hierarchy

Inherited Members

Inherited properties

Id
Id
Id
Id
,

Remarks

Interface inheritance

ISmsTextMessage inherits ISmsMessage. Types that implement ISmsTextMessage also implement the interface members of ISmsMessage.

Properties summary

Specifies the plain text body of the message.

Specifies the encoding type that has been set to use when sending this message.

Specifies the phone number of the sender of the message.

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

Retrieves 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.

Indicates 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.

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

Specifies the recipient phone number of this message.

Methods summary

Reads a message in the specified format and places the results in a new instance of a binary message.

Properties

  • Body
    Body
    Body
    Body

    Specifies the plain text body of the message.

    public string Body { get; set; }public string Body { get; set; }Public ReadWrite Property Body As stringpublic string Body { get; set; }

    Property Value

    • string
      string
      string
      string

      A string representing the body of the text message. If there were decoding problems, some characters in the original message can be represented by a wildcard character, typically a question mark: '?'.

  • Encoding
    Encoding
    Encoding
    Encoding

    Specifies the encoding type that has been set to use when sending this message.

    public SmsEncoding Encoding { get; set; }public SmsEncoding Encoding { get; set; }Public ReadWrite Property Encoding As SmsEncodingpublic SmsEncoding Encoding { get; set; }

    Property Value

  • From
    From
    From
    From

    Specifies the phone number of the sender of the message.

    public string From { get; set; }public string From { get; set; }Public ReadWrite Property From As stringpublic string From { get; set; }

    Property Value

    • string
      string
      string
      string

      A string representation of the phone number of the sender of this message. It should be in the format preferred by the device and the network it is registered on.

  • PartCount
    PartCount
    PartCount
    PartCount

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

    public uint PartCount { get; }public uint PartCount { get; }Public ReadOnly Property PartCount As uintpublic uint PartCount { get; }

    Property Value

    • uint
      uint
      uint
      uint

      An unsigned integer. If the message is standalone, the value is 1.

  • PartNumber
    PartNumber
    PartNumber
    PartNumber

    Retrieves 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.

    public uint PartNumber { get; }public uint PartNumber { get; }Public ReadOnly Property PartNumber As uintpublic uint PartNumber { get; }

    Property Value

    • uint
      uint
      uint
      uint

      An unsigned integer. It is one-based. It will not exceed PartCount + 1.

  • PartReferenceId
    PartReferenceId
    PartReferenceId
    PartReferenceId

    Indicates 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.

    public uint PartReferenceId { get; }public uint PartReferenceId { get; }Public ReadOnly Property PartReferenceId As uintpublic uint PartReferenceId { get; }

    Property Value

    • uint
      uint
      uint
      uint

      An unsigned integer determined by the sending network; it cannot be manipulated through this interface. If the network has its own policy on the lifetime of a multi-part message, this reference number might not be valid indefinitely.

  • Timestamp
    Timestamp
    Timestamp
    Timestamp

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

    public DateTime Timestamp { get; }public DateTimeOffset Timestamp { get; }Public ReadOnly Property Timestamp As DateTimeOffsetpublic DateTime Timestamp { get; }

    Property Value

  • To
    To
    To
    To

    Specifies the recipient phone number of this message.

    public string To { get; set; }public string To { get; set; }Public ReadWrite Property To As stringpublic string To { get; set; }

    Property Value

    • string
      string
      string
      string

      A string representation of the phone number, formatted in the phone number format favored by the device and the network that the device is registered on.

Methods

  • ToBinaryMessages(SmsDataFormat)
    ToBinaryMessages(SmsDataFormat)
    ToBinaryMessages(SmsDataFormat)
    ToBinaryMessages(SmsDataFormat)

    Reads a message in the specified format and places the results in a new instance of a binary message.

    public IVectorView<ISmsBinaryMessage> ToBinaryMessages(SmsDataFormat format)public IVectorView<ISmsBinaryMessage> ToBinaryMessages(SmsDataFormat format)Public Function ToBinaryMessages(format As SmsDataFormat) As IVectorView( Of ISmsBinaryMessage )public IVectorView<ISmsBinaryMessage> ToBinaryMessages(SmsDataFormat format)

    Parameters

    Returns

    • The new binary message that holds the result of this method call.

Device family

Windows Desktop Extension SDK (introduced v10.0.10240.0)

API contract

Windows.Devices.Sms.LegacySmsApiContract (introduced v1)

Capabilities

cellularMessaging
sms

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.DeprecatedAttribute
Windows.Foundation.Metadata.GuidAttribute

Details

Assembly

Windows.Devices.Sms.dll