Not discovering browsers on Android 11 when they are available.
czlucius opened this issue · 0 comments
On Android 11, due to a package query limitation, the app cannot scan for other apps(e.g. browsers) that can open the URL, when the browsers are indeed on the device.
This is due to <queries>
declaration in AndroidManifest.xml
not implemented properly, hence the app is not given permissions to scan for packages; intent.resolveActivity
always returns null
.
Steps to reproduce:
- Open the app
- Point the camera at a QR code/barcode which contains a web URL.
- Click the associated action, "Open link"
Expected behaviour:
App redirects to browser, or displays a chooser dialog if multiple browsers are available, or displays a toast "No browsers found" when no browsers to open the QR code are found.
Actual behaviour:
"No browsers found" displayed even when browsers are found. (see video attached)
Affected devices:
All devices running Android 11 (API 30) and above.
Possible solutions
- Remove the queries tag and add a try-catch block, catching
ActivityNotFoundException
, when no browsers are found. - Properly implement the
queries
tag, so that app has the proper permissions to scan for browsers (or apps with intent filterIntent.ACTION_VIEW
)