title: Which proguard configuration is missing for firebase messaging to work on Xamarin.Android?
body: <p>I've a Xamarin forms app packed for Android that I have deployed on the play store already. I tried &quot;SDK assemblies only&quot; for the linking along with the following proguard.cfg file:</p>
  <pre><code>-keep class com.google.android.gms.** { *; }
  -dontwarn com.google.android.gms.**
  -keep class com.google.gms.** { *; }
  -dontwarn com.google.gms.**
  -keep class com.google.firebase.** { *; }
  -dontwarn com.google.firebase.**
  -keep class android.support.v7.widget.** { *; }
  -dontwarn android.support.v7.widget.*
  -keep class android.support.v4.widget.Space { *; }
  -dontwarn android.support.v4.widget.Space
  </code></pre>
  <p>I've noted that the app works fine overall but Firebase never gives a token back to the app with this config. I am using the following implementation of <code>FirebaseMessagingService</code> and in my case <code>OnNewToken(string)</code> is never called:</p>
  <pre><code>[Service]
  [IntentFilter(new[] { &quot;com.google.firebase.MESSAGING_EVENT&quot; })]
  public class MyFirebaseMessagingService : FirebaseMessagingService
  {
      public MyFirebaseMessagingService()
      {
  
      }
      public override async void OnNewToken(string token)
      {
          try
          {
              await SecureStorage.SetAsync(&quot;fcm_token&quot;, token);
          }
          catch (Exception e)
          {
              // Possible that device doesn't support secure storage on device.
          }
      }
      public override void OnMessageReceived(RemoteMessage p0)
      {
          base.OnMessageReceived(p0);
          new NotificationHelper().CreateNotification(p0.Data);
      }
  
  }
  </code></pre>
  <p>The app works perfectly in debug mode and in release with Linking option set to &quot;None&quot; - Which is what I have currently on the play store so the app works at least... But obviously I would like make it cleaner and I am pretty sure I am not far from it.</p>
  <p>I've no more errors/warnings and I also tried to set the Ignore linking for assemblies: <code>Xamarin.Firebase.Common;Xamarin.Firebase.Iid;Xamarin.Firebase.Messaging</code> but that didn't help.</p>
  <p>What am I missing here in order to make firebase messaging works with linking set to &quot;SDK assemblies only&quot;?</p>