12

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

hvaughan3
  • 10,955
  • 5
  • 56
  • 76
David Hayes
  • 7,402
  • 14
  • 50
  • 62

1 Answers1

9

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.

Lanayx
  • 2,731
  • 1
  • 23
  • 35
  • Does it have something equivalent in Java based backend - https://github.com/Azure/azure-notificationhubs-java-backend – masT Sep 14 '17 at 10:29
  • @masT try asking directly in that repository by creating an issue – Lanayx Sep 17 '17 at 19:02