【问题标题】:Send broadcast Push Notification发送广播推送通知
【发布时间】:2017-02-17 07:27:12
【问题描述】:

我正在尝试向所有注册设备发送广播推送通知。

我看到NotificationHubClient中有以下2个方法:

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

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

在后者中,它声明tags 参数必须是非空的,如果它是空的将通过异常。

在前者中,它接受单个标签或标签表达式。

他们在文档中多次提到您可以向所有设备发送广播消息,但我找不到这样的示例。

【问题讨论】:

    标签: c# azure push-notification


    【解决方案1】:

    NotificationHubClient中有以下3个方法。

    您只需要此代码即可进行广播。

    public Task<NotificationOutcome> SendNotificationAsync(Notification notification);
    

    您不需要string tagExpressionIEnumerable&lt;string&gt; 标签

    【讨论】:

    • 你有一个例子吗,因为在我的情况下,我也想使用标签发送通知并广播两者,那么我该怎么做?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-05-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多