现在已经花了一周的时间寻找一种方法来制作由PWA制作的TWA应用程序,并上传到google商店,在沉浸式模式下工作。
根据https://bugs.chromium.org/p/chromium/issues/detail?id=965329的说法,这个东西是从chrome版本80开始实现的,但我找不到实现它的方法!
我已经制作了数字资产,并在google tool和Peter's Asset Link Tool上进行了验证
我的数字资产代码托管https://mal-war.com/.well-known/assetlinks.json:
[
{
"relation": [
"delegate_permission/common.handle_all_urls"
],
"target": {
"namespace": "android_app",
"package_name": "com.example.maliciouswar",
"sha256_cert_fingerprints": [
"F7:AC:EF:00:9B:58:E0:63:81:CA:5C:D0:7B:68:B8:90:9B:DD:BA:A8:3A:08:87:27:3E:81:38:66:CB:55:DC:39"
]
}
}]
在string.xml中的
<resources>
<string name="app_name">Malicious War</string>
<string name="asset_statements">
[{
\"relation\": [\"delegate_permission/common.handle_all_urls\"],
\"target\": {
\"namespace\": \"web\",
\"site\": \"https://mal-war.com\"}
}]
</string>
</resources>我也尝试过使用https://www.pwabuilder.com/,但是在我的android设备和模拟器上都不能在immorsive模式下工作。
发布于 2021-03-03 06:08:45
我最终找到了解决方案,就是添加下面这行:
<meta-data android:name="android.support.customtabs.trusted.DISPLAY_MODE"
android:value="immersive"/>转到AndroidManifest.xml
还有其他很棒的meta标签,你可以在here上找到它们。
https://stackoverflow.com/questions/66431281
复制相似问题