PushNotificationChannel 類別

定義

表示推播通知的傳遞車輛和定址機制。

協力廠商應用程式伺服器會使用此介面所代表的通道統一資源識別項 (URI) ,與 Windows 推播通知服務通訊 (WNS) 。 用戶端會使用推播通知通道來攔截通知。

public ref class PushNotificationChannel sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
class PushNotificationChannel final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class PushNotificationChannel final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public sealed class PushNotificationChannel
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class PushNotificationChannel
Public NotInheritable Class PushNotificationChannel
繼承
Object Platform::Object IInspectable PushNotificationChannel
屬性

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)
應用程式功能
internetClient

備註

這個物件會透過 IAsyncOperation 介面的實例傳回,此介面是透過 CreatePushNotificationChannelForApplicationAsync 方法傳回。 當非同步作業順利完成時,它會透過 thendone 方法傳回 PushNotificationChannel 物件。

屬性

ExpirationTime

取得通道到期的時間。 在此時間之後傳送給此通道的通知會遭到拒絕。

Uri

取得應用程式伺服器傳送推播通知給應用程式或系結至此通道之次要磚的統一資源識別項 (URI) 。 此統一資源識別項 (URI) 會傳輸至協力廠商應用程式伺服器並儲存。

方法

Close()

明確使這個通道失效。 呼叫此方法之後,不會傳遞任何推送至此通道的通知。

事件

PushNotificationReceived

當推播通知到達此通道時引發。

適用於

另請參閱