[英]TWA immersive mode
一周以來一直在尋找一種方法來制作由 PWA 制作並上傳到谷歌商店的 TWA 應用程序以沉浸式模式工作。
根據https://bugs.chromium.org/p/chromium/issues/detail?id=965329這個東西是從chrome 80版開始實現的,但是我找不到實現的方法!
我已經制作了數字資產並在谷歌工具和彼得的資產鏈接工具上進行了驗證
我的數字資產代碼托管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 模式下工作。
我終於找到了解決方案,就是添加這一行:
<meta-data android:name="android.support.customtabs.trusted.DISPLAY_MODE"
android:value="immersive"/>
到AndroidManifest.xml
還有其他很棒的元標記,你可以在這里找到它們。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.