【问题标题】:Azure Notification Hub installation not updating tagsAzure 通知中心安装不更新标签
【发布时间】:2016-04-20 04:02:10
【问题描述】:

我正在尝试在注册后更新 Azure 通知中心内的安装标记。为此,我正在关注几个指南,尤其是 herehere

这两个指南都建议以下代码应该可以工作,但显然不是;标签永远不会更新。没有错误,我可以保证installationId是正确的。我猜我错误地设置了标签的路径/值。

// in constructor:
var _notificationHub = NotificationHubClient.CreateClientFromConnectionString(Settings.ConnectionStrings.NotificationHub, Settings.Defaults.NotificationHubName);


// in WebApi endpoint:
var installationUpdates = new List<PartialUpdateOperation>();
var userDetail = _userDetailRepo.Get(id);

installationUpdates.Add(new PartialUpdateOperation
{
    Operation = UpdateOperationType.Replace,
    Path = "/tags/interestedin", // is this incorrect?
    Value = interestedIn.ToUpper()
});
userDetail.InterestedIn = interestedIn;

await Task.WhenAll(
    _userDetailRepo.InsertOrReplace(userDetail),
    _notificationHub.PatchInstallationAsync(installationId, installationUpdates));

这里是安装对象的标签,根据 VS:

我也尝试硬编码Path = "/tags/interestedin:W" 的路径,但没有任何区别。

谁能告诉我我是否在这里做错了什么,如果是,我应该如何修改我的代码。谢谢。

【问题讨论】:

    标签: c# azure azure-notificationhub


    【解决方案1】:

    很遗憾,Path = "/tags/interestedin" 目前无法正常工作。我们目前正在研究通配符的支持。完成后,“/tags/interestedin*”之类的内容就可以正常使用了。

    Path = "/tags/interestedin:W" 应该没问题。如果您可以提供命名空间名称、中心名称和时间范围,那么我将查看日志以检查那里发生了什么。

    【讨论】:

      猜你喜欢
      • 2018-04-01
      • 1970-01-01
      • 2020-05-22
      • 2016-09-14
      • 2015-04-16
      • 2015-11-01
      • 1970-01-01
      • 2020-04-26
      • 2018-04-24
      相关资源
      最近更新 更多