2

この github リポジトリhttps://github.com/GoogleChromeLabs/svgomg-twaのコードを使用して、TWA を使用して PWA を介して Android Play ストアにプッシュしようとしています。指示に従ってデジタル アセット リンクをデバッグすると、次のメッセージが表示されます。

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

仮想デバイスで URL バーが削除された場所。

ただし、Play ストアからダウンロードした実機からアプリにアクセスすると、URL バーが表示されます。さらに、PWA が「Powered by Chrome」であることを URL バーから確認しました。これは、Huawei P20 Pro および Samsung S8 で確認されています。

編集: build.gradle 構成が追加されました

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'
}
4

2 に答える 2