简体   繁体   English

发送广播推送通知

[英]Send broadcast Push Notification

I am trying to send a broadcast push notification to all registered devices. 我正在尝试向所有注册的设备发送广播推送通知。

I see that there are the following 2 methods in the NotificationHubClient : 我看到NotificationHubClient中有以下2种方法:

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

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

In the latter, it states that the tags parameter needs to be non-empty and will through an exception if it is empty. 在后者中,它声明tags参数必须为非空,如果为空,则将通过异常。

In the former, it accepts a single tag or tag expression. 在前者中,它接受单个标记或标记表达式。

They mention in the documentation multiple times that you can send broadcast messages to all devices but I cant find an example of this. 他们在文档中多次提到可以将广播消息发送到所有设备,但我找不到此示例。

There are the following 3 methods in the NotificationHubClient. NotificationHubClient中包含以下3种方法。

You need just this code for broadcasting. 您只需要此代码即可进行广播。

public Task<NotificationOutcome> SendNotificationAsync(Notification notification);

You don't need string tagExpression or IEnumerable<string> tags 您不需要string tagExpressionIEnumerable<string>标签

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM