I have my app set up for use with app links and that part works as expected, I use a link to launch the app and also pass some parameters to my starting page. However I have been trying to add a TWA to open a web page without url bar and I keep getting "Digital asset links verification failed on https://......". I have the correct sha-256 in the assetlinks.json, app link would not work if that was the case. Here's my AndroidManifest and strings.xml:
<meta-data
android:name="asset_statements"
android:resource="@string/asset_statements"/>
<meta-data
android:name="asset_statements_twa"
android:resource="@string/asset_statements_twa"/>
<activity
android:name=".MainActivity"
android:launchMode="singleTask"
android:theme="@style/LaunchTheme"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"
android:exported="true">
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="https"
android:host="assetlinkhost.domain.com" /> // My assetlinks.json is hosted here
</intent-filter>
</activity>
<activity
android:name="com.google.androidbrowserhelper.trusted.LauncherActivity"
android:label="TWA"
android:exported="true">
<meta-data
android:name="android.support.customtabs.trusted.DEFAULT_URL"
android:value="https://assetlinkhost.domain.com" /> // Same domain where TWA html file is hosted under a subfolder, it's a container on Amazon s3 serving static files.
<intent-filter
android:autoVerify="true">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/>
<!-- <data
android:scheme="https"
android:host="assetlinkhost.domain.com"/> --> // TWA hosted at the same domain where assetlinks.json is hosted. Commented this out to stop app links from breaking.
</intent-filter>
</activity>
strings.xml:
<resources>
<string name="asset_statements" translatable="false">[
{"include": "https://assetlinkhost.domain.com/.well-known/assetlinks.json"}]</string>
<string name="asset_statements_twa"> // Added this part for the TWA
[{
\"relation\": [\"delegate_permission/common.handle_all_urls\"],
\"target\": {
\"namespace\": \"web\",
\"site\": \"https://assetlinkhost.domain.com\"}
}]
</string>
</resources>
Is there something in my manifest or resources strings missing? Asset links file is set up correctly as app links work. The html file I am trying to open as a TWA is hosted at the same domain where the asset links is present (a container on Amazon s3 serving static files). At this point I've also tried to get it to work without any changes related to app links but the verification still fails. Not sure what is missing.