Azure的NotificationHub - 检测到发生故障的通知 [英] Azure NotificationHub - Detect failed notifications

查看:424
本文介绍了Azure的NotificationHub - 检测到发生故障的通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想失败的通知存储在分贝,例如客户端不具有网络连接。这将使我从 backgroundService 来检查是否有缺失的通知,然后从 backgroundService 创建它。

I am trying to store failed notifications in a db, e.g. client does not have internet access. This will enable me to check from a backgroundService if there is a missing notification, and then create it from the backgroundService.

因此​​,我有以下的,在我的 Azure的应用服务移动

I therefore have the following, on my Azure App Service Mobile:

var notStat = await hub.SendWindowsNativeNotificationAsync(wnsToast, tag);
telemetry.TrackTrace("failure : " + notStat.Failure + " | Results : " + notStat.Results + " | State : " + notStat.State + " | Success : " + notStat.Success + " | trackingID : " + notStat.TrackingId + ");

在code段是测试客户端的影响,但无论我做什么生成的日志就是这样的信息是排队的

因此​​,如何检测我失败的通知?

So how to I detect failed Notifications?

要总结为接受的答案提出的讨论:

To sum up the discussions made to the accepted answer:

在该通知已经发送时, NotificationId 等相关数据,存储在一个单独的表。

When the notification has been send, the NotificationId and other relevant data, is stored in a separate Table.

客户机接收到该通知上的事件,然后将消息发送到服务器,说明该通知被接收。的条目,然后从表中移除。

The event on the client receiving the notification, will then send a message to the server stating that the notification is received. The entry is then removed from the Table.

这则不受客户端收到的通知,将通过后台任务找到。这将是每次后台任务火灾,例如每6个小时,后台任务将检索所有丢失的通知。这使得后台任务以创建相关通知,用户不会错过任何通知。

The notifications that then are not received by the client, will through a background task be found. This will be every time the background task fires, e.g. every 6 hours, the background task will retrieve all the missing notifications. This enables the background task to create the relevant notifications and the user will not miss any notification.

推荐答案

的入队有望回归 - 请参阅的故障排除指南。关于什么发生更多的见解尝试设置EnableTestSend -

The return of enqueued is expected - please, refer to the troubleshooting guidance. For more insights on what is happened try to set the EnableTestSend -

result.State只会在执行结束陈述入队没有任何洞察发生在你的推动。现在你可以使用EnableTestSend布尔的(C)的文档

但要知道,启用EnableTestSend的时候,也有一些限制(在同一页上描述的,因此不会复制粘贴到此处,以避免过时的信息未来的问题)。

But be aware that when EnableTestSend is enabled, there are some limits (described on the same page, so will not copy paste it here to avoid the future issues with the outdated info).

您可以使用每个消息遥测功能或REST API,以及 - 提琴手+ 一些文档

You can use Per Message Telemetry functionality or REST API as well - Fiddler+some documentation.

而且,作为一个后续问题,有,所以我看到您有帮助的一些讨论:<一href=\"http://stackoverflow.com/questions/36554019/azure-notification-hub-how-to-view-per-message-telemetry/36556216#36556216\">first和<一个href=\"http://stackoverflow.com/questions/36557991/azure-notification-hub-why-is-notificationoutcome-notificationid-property-empty\">second.

And, as a follow-up questions, there were some discussions on SO i saw that you may find helpful: first and second.

和,作为最后一个,我会强烈建议(如果你没有还)要看一看的常见问题 - 它知道不同的平台是如何处理的通知,要避免这种情况,当你尝试调试东西,被德兴进行(例如是很重要的,也许如果该设备是离线,并且有通知,只有最后将传送等)。

And, as a last one, i would highly recommend (if you did not yet) to take a look at FAQ - it is important to know how different platforms handle the notifications, to avoid the situation when you try to debug something that was done by desing (for example, maybe, if the device is offline, and there are notifications, only the last will be delivered, etc).

这篇关于Azure的NotificationHub - 检测到发生故障的通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆