android-browser-helper icon indicating copy to clipboard operation
android-browser-helper copied to clipboard

Location and notification doesn't work if host is not included in intent filter

Open onkar-rentomojo opened this issue 2 years ago • 3 comments

Describe the bug TWA android browser helper delegation service don't work when host is not added in intent filters. For Location I get the error as your location is blocked and in case of notifications, they come through chrome instead of TWA

To Reproduce Steps to reproduce the behavior:

  1. Don't add host in intent filter
  2. Try accessing the location
  3. See error

Expected behavior User should be able to access the location and in case of notifications, they should come from notification delegation service instead of chrome

onkar-rentomojo avatar May 23 '22 08:05 onkar-rentomojo

This isn't a use case we support - your TWA should have intent filters for your website.

On Mon, 23 May 2022 at 09:12, Onkar Deshpande @.***> wrote:

Describe the bug TWA android browser helper delegation service don't work when host is not added in intent filters. For Location I get the error as your location is blocked and in case of notifications, they come through chrome instead of TWA

To Reproduce Steps to reproduce the behavior:

  1. Don't add host in intent filter
  2. Try accessing the location
  3. See error

Expected behavior User should be able to access the location and in case of notifications, they should come from notification delegation service instead of chrome

— Reply to this email directly, view it on GitHub https://github.com/GoogleChrome/android-browser-helper/issues/372, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4LBZPMHSFPLMQYFTGIVXDVLM4V3ANCNFSM5WU6QEMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

PEConn avatar May 23 '22 10:05 PEConn

We have intent filters for specific paths. Declaring just host will allow all the URLs to be opened in the app - which we don't want always.

onkar-rentomojo avatar May 23 '22 10:05 onkar-rentomojo

You could make your use case work by changing the intent filter to the whole host but then have LauncherActivity look at the Intent URL and just launch it in the browser in some cases. That would mostly work, but there may be some rough edges, for example if the user sees your app in the Android disambiguation prompt, clicks it and then are confused why the browser opens.

Otherwise, I'd say this is more of a feature request than a bug report as having an Intent filter for your entire origin is how TWAs were designed to work.

PEConn avatar May 24 '22 15:05 PEConn

This issue should be fixed by crbug.com/1357825

EiraGe avatar Dec 16 '22 10:12 EiraGe