0

Xamarin Android call fb://page stop working if not set query all packages, but this flag require special Google authorization. Is possible open facebook app without this flag on Android 11?

Before Android 11 this piece of code open Facebook app:

private async void Buttonfb_Tapped(object sender, EventArgs e)
{
    try {
        if (!await Launcher.TryOpenAsync(new Uri(string.Format("fb://page/{0}", AppData.FacebookId))))                {
            OpenUrl(string.Format("https://m.facebook.com/{0}", AppData.FacebookPage));
        }
    }
    catch {

    }
}

after Android 11 if not add in manifest

<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />

app open only browser address (fail to open "fb://page/id-page"). But adding this flag, play store require this: screenshot of play store request

  • 2
    please post the actual code you are using, not a vague description. And it is really helpful to include links or specific references instead of just saying "special Google authorization" or "this flag". – Jason Jun 16 '22 at 19:44
  • Post edit with piece of code and other infos – Software Magic Jun 17 '22 at 21:00

1 Answers1

0

There was some thing about the package-visibility is changed in the Android 11. You can check the official document:https://developer.android.com/about/versions/11/privacy/package-visibility

So if you want to make your app can access some other apps on the device, you can try to use the <queries> in the manifest instead of the permission.

You can check the similar case:android intent to open google maps in android 11 not working

Liyun Zhang - MSFT
  • 8,271
  • 1
  • 2
  • 14