我开发了一个渐进式 Web 应用程序,我想将它作为受信任的 Web Activity 发布到 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.
]
然后我签署了apk,构建并在Play商店发布。
在网站上,我通过 Digital Asset Link 创建了关联
https://www.bagnoadriatico.it/.well-known/assetlinks.json
“Statement List Generator and Tester”表示操作成功
“成功!托管 www.bagnoadriatico.it 授予应用程序深度链接到 com.simovinci.bagnoadriatico。”
https://developers.google.com/digital-asset-links/tools/generator
地址栏仍然可见,我不知道为什么。
https://www.bagnoadriatico.it/mobile返回 200 http 代码。
PWA 经过 100% Lighthouse 验证。
关键指纹是对的
=========================================
我尝试设置 launchUrl = "/"(在我将 302 删除到移动版本之前)但没有任何改变。地址栏仍然可见。
最佳答案
如果您使用了 Google Play 的应用签名,您的 SHA 256 会发生变化。解决方法是从 Play 商店下载您的应用,然后使用 Play 商店中的以下工具生成一个新的assetlinks.json 文件:
https://play.google.com/store/apps/details?id=dev.conn.assetlinkstool&hl=en
关于android - TWA - 数字 Assets 链接正常,但地址栏仍然可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56489790/