title: Azure NotificationHub - Detect failed notifications
body: <p>I am trying to store failed notifications in a <code>db</code>, e.g. client does not have internet access. This will enable me to check from a <code>backgroundService</code> if there is a missing notification, and then create it from the <code>backgroundService</code>.</p>
  <p>I therefore have the following, on my <code>Azure App Service Mobile</code>:</p>
  <pre><code>var notStat = await hub.SendWindowsNativeNotificationAsync(wnsToast, tag);
  telemetry.TrackTrace(&quot;failure : &quot; + notStat.Failure + &quot; | Results : &quot; + notStat.Results + &quot; | State : &quot; + notStat.State + &quot; | Success : &quot; + notStat.Success + &quot; | trackingID : &quot; + notStat.TrackingId + &quot;);
  </code></pre>
  <p>The code snippet was to test the impact from the client, but no matter what I do the resulting log is just that the message was <code>enqueued</code>.</p>
  <h1>Question</h1>
  <p>So how to I detect failed Notifications?</p>
  <h1>Conclusion</h1>
  <p>To sum up the discussions made to the accepted answer:</p>
  <p>When the notification has been send, the <code>NotificationId</code> and other relevant data, is stored in a separate Table.</p>
  <p>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.</p>
  <p>The notifications that then are not received by the client, will through a <code>background task</code> be found. This will be every time the <code>background task</code> fires, e.g. every 6 hours, the <code>background task</code> will retrieve all the missing notifications. This enables the <code>background task</code> to create the relevant notifications and the user will not miss any notification.</p>