2017-02-17 111 views
0

我試圖向所有註冊的設備發送廣播推送通知。發送廣播推送通知

我看到有以下2種方法在NotificationHubClient

  • public Task<NotificationOutcome> SendNotificationAsync(Notification notification, string tagExpression);

  • public Task<NotificationOutcome> SendNotificationAsync(Notification notification, IEnumerable<string> tags);

在後者中,它指出tags參數需要非空,並且如果它爲空則會通過例外。

在前者中,它接受單個標籤或標籤表達式。

他們在文檔中多次提到您可以向所有設備發送廣播消息,但是我找不到這樣的例子。

回答

0

NotificationHubClient中有以下3種方法。

您只需要此代碼進行廣播。

public Task<NotificationOutcome> SendNotificationAsync(Notification notification); 

你不需要string tagExpressionIEnumerable<string>標籤