trusted-web-activitytwa

TWA URL bar not hiding


we are tring to push in through our PWA to the Android Play store using TWA by using the codes from this github repository https://github.com/GoogleChromeLabs/svgomg-twa. By following the instructions to debug the digital asset links, I get the message:

$ adb logcat | grep -e OriginVerifier -e digital_asset_links
10-11 08:37:29.701  5299  5299 I cr_OriginVerifier: Verification succeeded.

Where the url bar is removed on the virtual device.

However, when accessing the app from an actual device downloaded from the Play store, the url bar is shown. Additionally, I've verified from the url bar that the PWA is "Powered by Chrome". This has been confirmed on Huawei P20 Pro and Samsung S8.

EDIT: build.gradle config added

apply plugin: 'com.android.application'

def twaManifest = [
    applicationId: 'health.tuli.portal',
    hostName: 'portal.tuli.health',
    launchUrl: '/',
    name: 'tuli.health',
    themeColor: '#522f81',
    backgroundColor: '#522f81',
    enableNotifications: true,
    useBrowserOnChromeOS: true
]

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId twaManifest.applicationId
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 6
        versionName "0.0.6"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

        resValue "string", "appName", twaManifest.name
        resValue "string", "launchUrl", "https://" + twaManifest.hostName + twaManifest.launchUrl
        resValue "string", "hostName", twaManifest.hostName
        resValue "string", "assetStatements",
                '[{ \\"relation\\": [\\"delegate_permission/common.handle_all_urls\\"],' +
                        '\\"target\\": {\\"namespace\\": \\"web\\", \\"site\\": \\"https://' +
                        twaManifest.hostName + '\\"}}]'

        resValue "color", "colorPrimary", twaManifest.themeColor
        resValue "color", "backgroundColor", twaManifest.backgroundColor
        resValue "string", "providerAuthority", twaManifest.applicationId + '.fileprovider'
        resValue "bool", "enableNotification", twaManifest.enableNotifications.toString()
        resValue "bool", "useBrowserOnChromeOS", twaManifest.useBrowserOnChromeOS.toString()
    }
    buildTypes {
        release {
            minifyEnabled true
            debuggable false
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.github.GoogleChrome.custom-tabs-client:customtabs:809a55cfa2'
}

Solution

  • So it turned out I was not using the correct sha256 cert fingerprint in my /.well-known/assetlinks.json file (as the original instructions I had led me to use the wrong SHA256 fingerprint). The way I obtained the correct SHA256 fingerprint was to install my PWA from the app store, and then download the app Asset Link Tool on the same device to find my package name and used the digital asset link provided in my /.well-known/assetlinks.json file.