CrossGeeks / FacebookClientPlugin

Facebook Client Plugin for Xamarin iOS and Android
MIT License
106 stars 32 forks source link

Android not using Facebook Native app for login on SDK 30+ #115

Open NGumby opened 1 year ago

NGumby commented 1 year ago

From this : https://developer.android.com/training/package-visibility facebook packages are not returned anymore by GetInstalledPackages, so IsAppInstalled returns false and always uses webview.

To fix, you can put this in your AndroidManifest, within the manifest tag

  <queries>
    <package android:name="com.facebook.katana" />
    <package android:name="com.facebook.lite" />
  </queries>

It think it could be fixed in the package by using this LoginManager.Instance.SetLoginBehavior(LoginBehavior.NativeWithFallback); instead of LoginManager.Instance.SetLoginBehavior(IsAppInstalled() ? LoginBehavior.NativeOnly : LoginBehavior.WebOnly);