title: Several instance of FirebaseApp in the same asp.net core project
body: <p>I am using Firebase to push notification with an asp.net core project to  a flutter android project.</p>
  <p>I am using the Firebase.DefaultInstance and FirebaseMessaging methode to push the notifications.</p>
  <p>But I was wondering is there a way to create several different FirebaseApp instances instead of the default one. (For example to use different instances to differentiate different types of users or creating several instance to be able to link different android applications to the same project later on)</p>
  <p>Snippet of the methode to push notfication with default instance:</p>
  <pre><code>            if (FirebaseApp.DefaultInstance == null)
              {
                  FirebaseApp.Create(new AppOptions() { Credential = GoogleCredential.FromFile(&quot;private_key_given_in_firebase.json&quot;) });
              }
              try
              {
                  resp += FirebaseMessaging.DefaultInstance.SendAsync(&quot;message&quot;).Result + &quot;;&quot;;
              }
  </code></pre>
  <p>I tried changing the methode to this:</p>
  <p>(outside the methode)</p>
  <pre><code>        private FirebaseMessaging messagingApp;
  
          private FirebaseApp otherApp;
  
  </code></pre>
  <p>(in methode)</p>
  <pre><code>if (otherApp== null)
              {
                  otherApp= FirebaseApp.Create(new AppOptions() { Credential = GoogleCredential.FromFile(&quot;private_key_given_in_firebase&quot;) });
              }
              try
              {
  
                  messagingApp= FirebaseMessaging.GetMessaging(otherApp);
                  resp += messagingApp.SendAsync(&quot;message&quot;).Result + &quot;;&quot;;
              }
  </code></pre>
  <p>but with this new way it only works once than it keeps entering the if equals null condition and giving an error that the instance already exists</p>