What happens when an Azure push notification fails to send?

旧时模样 提交于 2019-12-23 07:04:27

问题


Is there any documentation on what the NotificationOutcome class state looks like on a failure?

NotificationOutcome result = await _hub.SendNotificationAsync(azureNotification, tags);

The MSDN documentation is pretty (completely) useless.

I'm guessing non-zero for result.Failure and result.Success means something went wrong (both seem to be 0 on a success) result.State is maybe more useful but there doesn't seem to be much documentation on this either


回答1:


I've found the answer on this page

If the EnableTestSend property is set to false for a NotificationHubClient object, all Send* methods return a NotificationOutcome instance with State set to Enqueued, and no additional information. If EnableTestSend is true, State will be set to DetailedStateAvailable, and this class contains information about how many notifications were successfully delivered. In case of failures, it provides the specific outcome, in the same manner as the notification hub telemetry.

That means that Success and Failure mean the number of succeeded and failed notifications and will exist only if EnableTestSend parameter was set to true on client creation.



来源:https://stackoverflow.com/questions/25224204/what-happens-when-an-azure-push-notification-fails-to-send

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!