title: Xamarin Android Facebook AppInviteDialog not showing
body: <p>I'm using the Xamarin.FacebookSdk to display the App Invite Dialog. For iOS everything works great but for Android, nothing displays. </p>
  
  <p><strong>Update</strong></p>
  
  <p>It turns out iOS isn't always working. I actually get the following error sometimes:</p>
  
  <pre><code>[0:] Invite Failed Error Domain=com.facebook.sdk.core Code=9 "(null)"
  </code></pre>
  
  <p>I can step through the following code until it gets to the AppInv.Show. However, Show never shows anything. I tried having the Facebook app installed and without it installed.</p>
  
  <pre><code>public class FacebookService : IFacebookService
  {
      public void InviteFriends(string appLinkUrl, string previewImageUrl)
      {
          if (AppInviteDialog.CanShow())
          {
              var activity = Xamarin.Forms.Forms.Context as Activity;
              var content = new AppInviteContent.Builder().SetApplinkUrl(appLinkUrl).SetPreviewImageUrl(previewImageUrl).Build() as AppInviteContent;
              //AppInviteDialog.Show(activity, content);
              AppInviteDialog AppInv = new AppInviteDialog(activity);
              var callbackManager = CallbackManagerFactory.Create();
  
              var invitecallback = new CCallback();                
  
              AppInv.RegisterCallback(callbackManager, invitecallback);
              AppInv.Show(content); 
          }
      }       
  }
  
  public class CCallback : Java.Lang.Object, IFacebookCallback
  {        
      public void OnCancel()
      {
          System.Diagnostics.Debug.WriteLine($"Invite was cancelled");
      }
  
      public void OnError(FacebookException error)
      {
          System.Diagnostics.Debug.WriteLine($"Invite failed {error.Message}");
      }
  
      public void OnSuccess(Java.Lang.Object result)
      {
          System.Diagnostics.Debug.WriteLine($"Invite was a success: {result}");
      }
  }
  </code></pre>
  
  <p>I added the following to the AndroidManifest.xml</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  ........
  
  &lt;meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id" /&gt;
      &lt;activity android:name="com.facebook.FacebookActivity" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:label="@string/app_name" /&gt;
      &lt;provider android:authorities="com.facebook.app.FacebookContentProviderXXXXXMy App IdXXXX" android:name="com.facebook.FacebookContentProvider" android:exported="true" /&gt;
  </code></pre>