Azure 通知中心:为什么 NotificationOutcome NotificationId 属性为空? [英] Azure Notification Hub: Why is NotificationOutcome NotificationId Property Empty?
问题描述
使用标准通知中心,我想使用返回的 NotificationId 和此其余 API 查看特定消息的遥测:
Using a Standard Notification Hub, I want to view telemetry for a specific message using the returned NotificationId and either this rest API:
https://msdn.microsoft.com/en-us/图书馆/天蓝色/mt608135.aspx
或 NotificationHubClient GetNotificationOutcomeDetailsAsync 方法:
or the NotificationHubClient GetNotificationOutcomeDetailsAsync method:
无论哪种方式,我都需要在发送消息时应该从集线器返回的通知消息 ID.
Either way, I need the Notification Message Id that is supposed to be returned from the hub when sending the message.
我使用 SendTemplateNotificationAsync 方法从应用后端发送消息:
I am sending the message from the app backend using the SendTemplateNotificationAsync method:
NotificationOutcome result = await hub.SendTemplateNotificationAsync(params, tags);
发送模板通知后,result.NotificationId 属性为空.如何获取 NotificationId 以便获取遥测数据?
After sending the template notification, the result.NotificationId property is empty. How can I get the NotificationId so I can then get the telemetry?
更新:
我在创建 NotificationHubClient 时尝试将 enableTestSend 属性设置为 true.结果仍然不包含 NotificationId.
I tried setting the enableTestSend property to true when creating the NotificationHubClient. The result still does not contain a NotificationId.
目前只有一个设备(安装)在集线器中注册.这可能是由于接收推送的设备数量少吗?
Currently there is only one device (installation) registered in the hub. Could this be due to a low number of devices receiving the push?
推荐答案
发布此内容以帮助可能遇到此问题的其他人.
Posting this for the benefit of others who may encounter this issue.
一位 Azure 支持工程师联系了我,他帮助我解决了问题.我最近从免费层切换到标准层,通知中心中存在与更改订阅层相关的错误.这需要支持工程师强制同步缓存" - 从而解决了问题.
I was contacted by an Azure support engineer who helped me resolve the problem. I had recently switched from the Free to the Standard tier, and there is a bug in Notification Hubs related to changing subscription tiers. This required the support engineer to "force sync the cache" - which resolved the issue.
该错误已修复,即将推出.如果您遇到此问题,我建议您联系 Azure 支持.
The bug has been fixed and will be rolling out soon. If you encounter this issue I would suggest contacting Azure support.
这篇关于Azure 通知中心:为什么 NotificationOutcome NotificationId 属性为空?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!