Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What happens when an Azure push notification fails to send?

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

like image 446
David Hayes Avatar asked Aug 09 '14 23:08

David Hayes


1 Answers

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.

like image 152
Lanayx Avatar answered Oct 24 '22 04:10

Lanayx