【问题标题】:Notification used for Azure Notification Hub's DirectSend用于 Azure 通知中心的 DirectSend 的通知
【发布时间】:2017-03-09 11:05:19
【问题描述】:

我尝试为 ANH .NET SDK 实现 DirectSend。

NotificationHubClient.SendDirectNotificationAsync(Notification notification, string deviceHandle);

我想知道使用这个 Notification 对象的最佳方式是什么?与 ANH 客户端上存在的所有 SendNative 调用不同,在任何地方都没有关于此的文档。

抽象的Notification类的构造函数

public Notification(Dictionary<string, string> additionalHeaders, string tag);

我需要包含哪些标题?目前我没有

它必须包含一个标签吗?我不打算在我的集线器上使用安装或注册,所以无论如何我都不会使用任何标签?

我假设我需要创建自己的具体通知类型并设置此对象的所有其他属性,例如 PlatformTypeContentType 等?

【问题讨论】:

    标签: ios azure notifications azure-notificationhub


    【解决方案1】:

    通知是一个抽象类。每个平台都有特定的通知类,例如:AppleNotification/AdmNotification/GCMNotification/WindowsNotification。您应该使用与您定位的平台相对应的类。

    以下 API 有助于传递额外的平台特定标头。而且直接发送不需要传递任何标签。

    public Notification(Dictionary<string, string> additionalHeaders, string tag);
    

    您可以在此处找到有关 DirectSend 的更多信息:https://msdn.microsoft.com/en-us/library/azure/mt608572.aspx

    【讨论】:

      猜你喜欢
      • 2019-08-25
      • 2014-07-15
      • 1970-01-01
      • 2021-08-03
      • 1970-01-01
      • 1970-01-01
      • 2013-10-10
      • 1970-01-01
      • 2018-04-28
      相关资源
      最近更新 更多