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

Add ability to open apps and browsers from TWA

Open lunush opened this issue 4 years ago • 2 comments

Is your feature request related to a problem? Please describe. Currently, all links open within TWA and intent:// links don't work.

Describe the solution you'd like Ability to through user outside TWA for all non-app related links. It would be awesome if there would be an option to let user select where they want to open a link, just like in a native app. Opening maps in a selected map application, social media link in an app I want, etc.

Additional context It is possible to open links outside PWA from browsers and WebView. WebView even has a method shouldOverrideUrlLoading that lets developer decide how links should behave. CustomTabs doesn't seem to offer anything. An exception could be execCommand, but I am not an Android/Java developer, so don't understand what to do with it.

If there is at least some way to achieve this behaviour, please share it.

lunush avatar Oct 15 '21 20:10 lunush

We achieved that using :

window.location.replace("deeplinkPattern://myDeeplink");

(deeplinkPattern is referenced in our AndroidManifest as a browsable intent-filter)

dalexanco avatar Feb 03 '22 10:02 dalexanco

There may be privacy concerns regarding the intents and deep linking. However, for http/https URLs I wish there was a way to allowlist the URLs that we want "in-app" (within the TWA context) versus "go to default browser"

tomasdev avatar Nov 06 '23 22:11 tomasdev