android-browser-helper
android-browser-helper copied to clipboard
Location and notification doesn't work if host is not included in intent filter
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:
- Don't add host in intent filter
- Try accessing the location
- 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
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:
- Don't add host in intent filter
- Try accessing the location
- 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: @.***>
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.
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.
This issue should be fixed by crbug.com/1357825