SmsReceivedEventDetails 類別

定義

將 SMS 訊息事件的詳細資料呈現至在應用程式暫停時處理訊息的背景工作專案。

注意

這項功能僅適用于行動電信業者應用程式和 UWP 應用程式,由行動網路操作員、行動寬頻介面卡 IHV 或 OEM 提供特殊許可權存取。 如需詳細資訊,請參閱 行動寬頻

注意

此類別及其方法支援維護舊版 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 會暫停不在前景的應用程式,以延長電池使用時間。 如果您的應用程式即使在暫停時也需要處理新的 SMS 訊息,它必須建立背景工作專案來處理此訊息。 當新的 SMS 訊息送達時,背景工作專案就會啟動。

屬性

BinaryMessage

取得背景工作所接收之 SMS 訊息的二進位訊息物件。

DeviceId

傳回接收 SMS 訊息之網路介面的 DeviceInformation 識別碼。 此識別碼可以傳遞至 SmsDevice.FromIdAsync 來啟用裝置並擷取其他訊息詳細資料。

MessageClass

取得背景工作所接收之 SMS 訊息的訊息類別。

MessageIndex

傳回引發事件之新訊息的索引。 您可以將此值傳遞至 SmsDevice.GetMessageAsync ,以擷取新的訊息本身。

適用於