SmsReceivedEventDetails 类

定义

向后台工作项显示短信事件的详细信息,这些工作项在应用暂停时处理消息。

注意

此功能仅适用于由移动网络运营商、移动宽带适配器 IHV 或 OEM 授予特权访问权限的移动运营商应用和 UWP 应用。 有关详细信息,请参阅 移动宽带

注意

此类及其方法支持用于维护在早期版本的 Windows 中使用它的旧桌面应用。 如果使用此类,则必须在应用的清单中指定 Windows.Devices.Sms.LegacySmsApiContract 。 如果要开发适用于 Windows 的新应用,请不要使用此类。 请改用此命名空间中不需要 Windows.Devices.Sms.LegacySmsApiContract 的 API。

public ref class SmsReceivedEventDetails sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Devices.Sms.LegacySmsApiContract, 65536)]
/// [Windows.Foundation.Metadata.Deprecated("SmsReceivedEventDetails may be altered or unavailable for releases after Windows 10. Instead, use SmsMessageReceivedTriggerDetails.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Devices.Sms.LegacySmsApiContract)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class SmsReceivedEventDetails final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Devices.Sms.LegacySmsApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Deprecated("SmsReceivedEventDetails may be altered or unavailable for releases after Windows 10. Instead, use SmsMessageReceivedTriggerDetails.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Devices.Sms.LegacySmsApiContract")]
class SmsReceivedEventDetails final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Devices.Sms.LegacySmsApiContract), 65536)]
[Windows.Foundation.Metadata.Deprecated("SmsReceivedEventDetails may be altered or unavailable for releases after Windows 10. Instead, use SmsMessageReceivedTriggerDetails.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Devices.Sms.LegacySmsApiContract))]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class SmsReceivedEventDetails
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Devices.Sms.LegacySmsApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Deprecated("SmsReceivedEventDetails may be altered or unavailable for releases after Windows 10. Instead, use SmsMessageReceivedTriggerDetails.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Devices.Sms.LegacySmsApiContract")]
public sealed class SmsReceivedEventDetails
Public NotInheritable Class SmsReceivedEventDetails
继承
Object Platform::Object IInspectable SmsReceivedEventDetails
属性

Windows 要求

设备系列
Windows Desktop Extension SDK (在 10.0.10240.0 中引入)
API contract
Windows.Devices.Sms.LegacySmsApiContract (在 v1.0 中引入)
应用功能
cellularMessaging sms

注解

Windows 通过暂停不在前台的应用程序来延长电池使用时间。 如果应用程序需要在挂起时处理新短信,则需要创建后台工作项来处理此消息。 当新的短信到达时,后台工作项将激活。

属性

BinaryMessage

获取后台任务收到的短信的二进制消息对象。

DeviceId

返回接收短信的网络接口的 DeviceInformation ID。 此 ID 可以传递给 SmsDevice.FromIdAsync 以激活设备并检索其他消息详细信息。

MessageClass

获取后台任务收到的短信的消息类。

MessageIndex

返回引发事件的新消息的索引。 可以将此传递给 SmsDevice.GetMessageAsync 以检索新消息本身。

适用于