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
688 stars 286 forks source link

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

Closed onkar-rentomojo closed 1 year ago

onkar-rentomojo commented 2 years ago

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

PEConn commented 2 years ago

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: @.***>

onkar-rentomojo commented 2 years ago

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.

PEConn commented 2 years ago

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.

EiraGe commented 1 year ago

This issue should be fixed by crbug.com/1357825