Share via


PushNotificationChannelManagerForUser.CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync 方法

定義

多載

CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer, String)

建立系結至指定應用程式的物件,您可以從 Windows 推播通知服務擷取推播通知通道, (WNS) 。 指定的應用程式必須與呼叫的應用程式位於相同的套件中。

CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer, String, String)

建立系結至指定應用程式的物件,您可以從 Windows 推播通知服務擷取推播通知通道, (WNS) 。 指定的應用程式必須與呼叫的應用程式位於相同的套件中。

CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer, String)

建立系結至指定應用程式的物件,您可以從 Windows 推播通知服務擷取推播通知通道, (WNS) 。 指定的應用程式必須與呼叫的應用程式位於相同的套件中。

public:
 virtual IAsyncOperation<PushNotificationChannel ^> ^ CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer ^ appServerKey, Platform::String ^ channelId) = CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync;
/// [Windows.Foundation.Metadata.Overload("CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<PushNotificationChannel> CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer const& appServerKey, winrt::hstring const& channelId);
[Windows.Foundation.Metadata.Overload("CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<PushNotificationChannel> CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer appServerKey, string channelId);
function createRawPushNotificationChannelWithAlternateKeyForApplicationAsync(appServerKey, channelId)
Public Function CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync (appServerKey As IBuffer, channelId As String) As IAsyncOperation(Of PushNotificationChannel)

參數

appServerKey
IBuffer

ANSI X9.62 格式的未壓縮金鑰。 此值來自 安全雜湊標準規格中定義的 P-256 曲線。

channelId
String

Platform::String

winrt::hstring

推播通知通道的識別碼。

傳回

物件,系結至 appServerKey 中指定的應用程式伺服器,用來向 WNS 要求 PushNotificationChannel

屬性

Windows 需求

裝置系列
Windows 10 Creators Update (已於 10.0.15063.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v4.0 引進)

備註

請注意,透過此通道傳送的所有原始通知都會附加 channelID,再傳遞至應用程式。 這可讓應用程式建立多個通道,並區分通知的來源。

適用於

CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer, String, String)

建立系結至指定應用程式的物件,您可以從 Windows 推播通知服務擷取推播通知通道, (WNS) 。 指定的應用程式必須與呼叫的應用程式位於相同的套件中。

public:
 virtual IAsyncOperation<PushNotificationChannel ^> ^ CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer ^ appServerKey, Platform::String ^ channelId, Platform::String ^ appId) = CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync;
/// [Windows.Foundation.Metadata.Overload("CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsyncWithId")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<PushNotificationChannel> CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer const& appServerKey, winrt::hstring const& channelId, winrt::hstring const& appId);
[Windows.Foundation.Metadata.Overload("CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsyncWithId")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<PushNotificationChannel> CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync(IBuffer appServerKey, string channelId, string appId);
function createRawPushNotificationChannelWithAlternateKeyForApplicationAsync(appServerKey, channelId, appId)
Public Function CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync (appServerKey As IBuffer, channelId As String, appId As String) As IAsyncOperation(Of PushNotificationChannel)

參數

appServerKey
IBuffer

ANSI X9.62 格式的未壓縮金鑰。 此值來自 安全雜湊標準規格中定義的 P-256 曲線。

channelId
String

Platform::String

winrt::hstring

推播通知通道的識別碼。

appId
String

Platform::String

winrt::hstring

要系結至推播通知通道之應用程式的套件相對應用程式識別碼 (PRAID) 。 指定的應用程式必須與呼叫的應用程式位於相同的套件中。 如需 PRAID 的詳細資訊,請參閱Application元素的Id屬性。

如果您要在跨進程 COM 伺服器中裝載背景工作 () ,請與主要應用程式分開,然後傳遞作為應用程式引數 applicationId ,以在自己的套件資訊清單中定義 windows.backgroundTask 延伸模組的應用程式 PRAID。

傳回

物件,系結至 appServerKey 中指定的應用程式伺服器,用來向 WNS 要求 PushNotificationChannel

屬性

Windows 需求

裝置系列
Windows 10 Creators Update (已於 10.0.15063.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v4.0 引進)

備註

透過此通道傳送的所有原始通知都會附加 channelID,再傳遞至應用程式。 這可讓應用程式建立多個通道,並區分通知的來源。

注意

大部分的應用程式 (包括所有協力廠商應用程式) 應該使用 CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync 而不需 appID 參數。

適用於