1

I'm using uri_launcher package to open a phone call and SMS app. To check if it's possible to launch some URI package docs state this:

On Android (from API 30), [canLaunch] will return false when the required /// visibility configuration is not provided in the AndroidManifest.xml file. /// For more information see the Managing package visibility /// article in the Android docs.

I've tried just launching some websites and phone numbers and it works just fine (without calling the canLaunch()).

What do I need to add to AndroidManifest.xml to make this work ? I've tried with <query> didn't work, also the <grant-uri-permission> didn't work. Function is stil returning false.

Is it okay if I just launch the URI ? What are the downsides of that ?

1 Answers1

8

You can solve this issue by adding the following line to your AndroidManifest.xml file:

<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
Code on the Rocks
  • 11,488
  • 3
  • 53
  • 61