GoogleChrome / android-browser-helper

The Android Browser Helper library helps developers use Custom Tabs and Trusted Web Activities on top of the AndroidX browser support library.
Apache License 2.0
695 stars 289 forks source link

Google Chrome not shows the "access to camera" prompt after version 122 #464

Open zeitungen opened 7 months ago

zeitungen commented 7 months ago

Describe the bug Trusted Web Activity after Google Chrome version 122 no longer shows the "access to camera" prompt. However, the same web application opened directly in Chrome still works well and the prompt appears. Other informations, same application not trusted (app displays the navigation bar), the prompt also appears. With Firefox, the prompt is displayed.

This issue is also documented on stackoverflow

To Reproduce Steps to reproduce the behavior:

  1. Install Attrius Facilities app
  2. Click on 'Enter offline mode'
  3. Click on + button (located to bottom right of the screen)
  4. Enter a name ('A' for example) and save
  5. Click on new item (A) into the list
  6. Click on + button (located to bottom right of the screen)

Expected behavior A barcode scanner appears. For the first time, a camera prompt should appears.

Did this ever used to work With chrome <122 installed, the camera prompt appears With not trusted app and the navigation bar displayed, the camera prompt appears. Navigate with chrome to the web site, the camera prompt appears.

Screenshots into android app, no camera prompt image

into chrome, camera prompt is displayed image

Smartphone (please complete the following information):

Device OS Browser Browser version android-browser-helper library version
Samsung Galaxy A53 Android 14 Chrome 122.0.6261.105 2.5.0
Google Pixel 6 Android 14 Chrome 122.0.6261.105 2.5.0
Samsung Galaxy S8 Android 9 Chrome 122.0.6261.90 2.5.0
khelben5 commented 7 months ago

Hello, everyone. We at GoodNotes are also experiencing a very similar issue. We have prepared a basic example in this repository with instructions on reproducing it. I hope it helps bring light into the problem.

khmyznikov commented 7 months ago

Same for microphone

khmyznikov commented 7 months ago

Raised this as bug in chromium: https://issues.chromium.org/issues/330175031

woodreamz commented 7 months ago

Raised this as bug in chromium: https://issues.chromium.org/issues/330175031

Thank you for raising it! It seems to be a regression introduced in v122, they are investigating the issue.

tomayac commented 7 months ago

It seems this was fixed via https://chromium-review.googlesource.com/c/chromium/src/+/5381675.

build3r commented 1 month ago

If you still encounter this issue, The latest Samsung Internet browser declares “Trusted Web Activity” support and continues to utilize Chromium v122. Given users might not have changed their default browser, this has become a significant concern.

The library should provide a whitelist option to choose TWA providers, or fall back to Chrome custom tabs.