PushNotificationManager.CreateChannelAsync(Guid) 方法

定義

以非同步方式從 Windows 推播通知服務 (WNS) 要求推播通道。

注意

PushNotificationManager類別相依于Singleton 套件。 由於該相依性,如果您要從 獨立應用程式呼叫這些 API,請務必注意。 如需詳細資訊和細節,請參閱 其他 MSIX 套件的相依性

public:
 virtual IAsyncOperationWithProgress<PushNotificationCreateChannelResult ^, PushNotificationCreateChannelStatus> ^ CreateChannelAsync(Platform::Guid remoteId) = CreateChannelAsync;
IAsyncOperationWithProgress<PushNotificationCreateChannelResult, PushNotificationCreateChannelStatus> CreateChannelAsync(winrt::guid const& remoteId);
public IAsyncOperationWithProgress<PushNotificationCreateChannelResult,PushNotificationCreateChannelStatus> CreateChannelAsync(Guid remoteId);
function createChannelAsync(remoteId)
Public Function CreateChannelAsync (remoteId As Guid) As IAsyncOperationWithProgress(Of PushNotificationCreateChannelResult, PushNotificationCreateChannelStatus)

參數

remoteId
Guid

Platform::Guid

winrt::guid

所建立推播通道的遠端識別碼。 這個值稱為 Azure AppId,是符合 Azure Active Directory (AAD) 中所指定應用程式識別碼的 GUID。 如需取得應用程式識別碼的資訊,請參閱 使用入口網站建立可存取資源的 Azure AD 應用程式和服務主體

傳回

非同步動作,其進度會在完成時傳回 PushNotificationCreateChannelResult

備註

在大部分情況下,通道建立要求應該會在幾秒鐘內完成。 因為這是網路作業,通道要求作業一開始可能會失敗,這會觸發平臺內建的重試邏輯。 在這些情況下,通道要求作業可能需要 2 到 16 分鐘。

適用於