As part of our app requirement, we are opening a webpage in a TWA fashion. We have been using chrome as our TWA provider passing non-whitelisted CORS headers.
Firefox (org.mozilla.firefo) doesn't support TWA. onRelationshipValidationResult is never called.
Edge (com.microsoft.emmx) supports TWA, but doesn't support passing header all the time (the way shown in the demo project)
Samsung (com.sec.android.app.sbrowser) doesn't support TWA. onRelationshipValidationResult is never called.
Is this an issue with this library? How do we solve this?
Consequently, we decided to force the TWA provider to chrome (com.android.chrome).
The bug is, with edge installed and set to the default browser, even after setting the package name to that of chrome, the .launch() method still opens edge browser.
Attached below is the code
private val chromePackageName = "com.android.chrome"
val packageName =
CustomTabsClient.getPackageName(context, listOf(chromePackageName))
CustomTabsClient.bindCustomTabsService(
context,
packageName,
customTabsServiceConnection!!
)
val intentBuilder = TrustedWebActivityIntentBuilder(uri)
val intent = intentBuilder.build(customTabsSession!!)
// intent.intent.getPackage() always returns com.android.chrome, even if chrome is NOT set default
TwaLauncher(context).launch(intentBuilder, null, null, null) // this still opens edge
Steps to reproduce the behavior:
Have Edge browser installed and set to default app
On passing the chrome package name in the code snippet above still launched edge.
The expected behavior is that it should launch the chrome app in TWA and not Edge. What is the correct way to force open the TWA to the chrome browser?
Device: Android Emulator arm64-v8a
OS: Android 12
Browsers Installed: Chrome, Edge
Browser Versions: Edge(105.0.1343.50), Chrome(106.0.5249.126), Samsung and firefox (latest on the playstore)
Hi guys,
As part of our app requirement, we are opening a webpage in a TWA fashion. We have been using chrome as our TWA provider passing non-whitelisted CORS headers.
Only recently, we started testing on other browsers that support TWA as mentioned here https://github.com/GoogleChrome/android-browser-helper/blob/main/docs/trusted-web-activity-browser-support.md and as per our testing
Is this an issue with this library? How do we solve this?
Consequently, we decided to force the TWA provider to chrome (com.android.chrome).
The bug is, with edge installed and set to the default browser, even after setting the package name to that of chrome, the .launch() method still opens edge browser.
Attached below is the code
Steps to reproduce the behavior:
The expected behavior is that it should launch the chrome app in TWA and not Edge. What is the correct way to force open the TWA to the chrome browser?