title: Xamarin - Oreo (API 26) Firebase Cloud Messaging background notifications not showing in notification drawer
body: <p>I'm developing an Android application using Visual Studio + Xamarin and trying to receive background Firebase Cloud Messaging notifications on Oreo (API 26).</p>
  
  <p><strong>Problem</strong><br>
  When my app is backgrounded, notifications are not displayed in the notification drawer (only on Android API 26 Oreo). However notifications are working when the app is foregrounded.</p>
  
  <p><strong>Comments</strong><br>
  The FCM notifications are working on all other build versions &lt; 26, including background and foreground FCM messages (these appear in the notification drawer and I am able to launch my application from a backgrounded state, or if it's foregrounded the app opens the correct intent).</p>
  
  <hr>
  
  <p>My settings are as follows;</p>
  
  <h2>Manifest</h2>
  
  <pre><code>Target Android Version: Android 8.0 (API level 26)
  Minimum Android Version: Android 4.1 (API level 16)
  </code></pre>
  
  <h2>Android Build Tools</h2>
  
  <pre><code>Android SDK Tools 26.1.1
  Android SDK Platform-Tools 26.0.2
  Android SDK Build Tools 26.0.2
  </code></pre>
  
  <h2>Firebase Cloud Messaging Payload</h2>
  
  <p>I'm sending the following FCM payload using the node.js firebase library:</p>
  
  <pre><code>var payload = {
      notification: {
          title: "My Title",
          body: "My body"
      },
      data: {
          type: 'A_CUSTOM_TYPE_VARIABLE'
      }
  };
  </code></pre>
  
  <hr>
  
  <p><strong>Errors in Xamarin Application Output</strong><br>
  When I send an FCM from my server or via the firebase console and the app is in the background I can see that the app receives the FCM but errors before it reaches my code. There is an event output in the application output panel which reads:</p>
  
  <pre><code>[Notification] Use of stream types is deprecated for operations other than volume control
  [Notification] See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
  </code></pre>
  
  <p><strong>Developer Options Warning Toast</strong>  </p>
  
  <pre><code>Settings &gt; System &gt; Developer Options &gt; Show notification channel warnings (turn on)  
  </code></pre>
  
  <p>I've turned on 'Show notification channel warnings' in the developer options and I am now seeing the following error message when I broadcast and FCM message (whilst app is backgrounded): </p>
  
  <p><a href="https://i.stack.imgur.com/E3uvw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/E3uvw.png" alt="Image showing developer warning message when sending FCM"></a></p>
  
  <hr>
  
  <p><strong>Related Stackoverflow posts</strong><br>
   - <a href="https://stackoverflow.com/questions/46990995/on-android-8-oreo-api-26-and-later-notification-doesnt-displayed">Oreo API 26 notification not displaying</a> - Solution only talks
     about how you construct your notification. However, the
     FirebaseMessageReceiever or MainActivity does not even fire in my
     case.<br>
   - <a href="https://stackoverflow.com/questions/45395669/notifications-fail-to-display-in-android-oreo-api-26">Notifications fail to display in Oreo</a> - Looks like there is a
     bug in the support library.</p>