TWA - 数字资产链接正常,但地址栏仍然可见

Sim*_*nci 5 android gradle progressive-web-apps trusted-web-activity

我开发了一个渐进式 Web 应用程序,我想将它作为受信任的 Web 活动发布在 Play 商店中。这是https://www.bagnoadriatico.it

遵循本指南 https://developers.google.com/web/updates/2019/02/using-twa

我从https://github.com/GoogleChromeLabs/svgomg-twa下载了示例

我改变了配置

def twaManifest = [
    applicationId: 'com.simovinci.bagnoadriatico',
    hostName: 'www.bagnoadriatico.it', // The domain being opened in the TWA.
    launchUrl: '/mobile', // The start path for the TWA. Must be relative to the domain.
    name: 'BagnoAdriatico di Casalborsetti', // The name shown on the Android Launcher.
    themeColor: '#ff5c14', // The color used for the status bar.
    backgroundColor: '#ffff00' // The color used for the splash screen background.
]
Run Code Online (Sandbox Code Playgroud)

然后我签署了 apk,构建并发布到 Play 商店。

在我通过数字资产链接创建关联的网站 https://www.bagnoadriatico.it/.well-known/assetlinks.json “Statement List Generator and Tester” 说操作成功 “Success! Host www.bagnoadriatico .它授予应用程序深层链接到 com.simovinci.bagnoadriatico。” https://developers.google.com/digital-asset-links/tools/generator

地址栏仍然可见,我不知道为什么。

https://www.bagnoadriatico.it/mobile返回 200 http 代码。PWA 经过 100% 灯塔验证。关键指纹是对的

========================================

我试图设置 launchUrl = "/" (在我将 302 删除到移动版本之前)但没有任何改变。地址栏仍然可见。

小智 6

如果您使用了 Google Play 的应用签名,您的 SHA 256 会发生变化。解决方法是从 Play 商店下载您的应用,然后使用以下同样来自 Play 商店的工具生成新的 assetlinks.json 文件:

https://play.google.com/store/apps/details?id=dev.conn.assetlinkstool&hl=en