【发布时间】:2019-10-22 16:38:57
【问题描述】:
我开发了一个渐进式网络应用程序,我想将它作为受信任的网络活动发布到 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 删除到移动版本之前)但没有任何改变。地址栏仍然可见。
【问题讨论】:
-
尝试生成一个发布APK并在您的手机上试用。地址栏不应该在那里。
-
当我生成一个发布 APK 并将它安装到我的手机上时,地址栏仍然隐藏。问题是当我在 Store 上发布应用程序时。
-
可能是 /mobile 有问题。未安装在根目录下时,我遇到了 pwa 问题。这只是一个想法。你可以试试mobile.bagnoadriatico.it 吗?
-
我尝试使用 www.bagnoadriatico.it ,但我的 PWA 使用 302 http 代码将移动流量重定向到 /mobile。我认为 TWA 需要 200 个 http 代码。我可以试试 mobile.bagnoadriatico.it 我会告诉你的,谢谢
-
我尝试将 launchUrl 设置为根目录(在我将 302 删除到移动版本之前),但没有任何改变。地址栏仍然可见。
标签: android gradle progressive-web-apps trusted-web-activity