簡體   English   中英

使用 bubblewrap 生成的 TWA 應用程序在瀏覽器中打開,而不是作為應用程序打開

[英]TWA app generated using the bubblewrap opens in browser instead of as an app

創建要在 google play store 上發布的 PWA。 使用bubblewrap cli生成的apk 安裝良好,但在谷歌應用程序而不是獨立應用程序中像普通網站一樣打開。 它的頂部有一個網址欄。 請參考截圖。

那么,如何創建一個看起來像普通安卓應用的應用呢?

附上截圖和twa-manifest.json和網站的manifest.json文件

Facpro PWA 屏幕截圖 - 顯示帶有 url 欄的應用程序屏幕

注意:鏈接是假的

// twa-manifest.json

{
  "packageId": "app.web.facpro.twa",
  "host": "facpro.web.app",
  "name": "FACPRO - Faculty Research Progress",
  "launcherName": "FACPRO",
  "display": "fullscreen",
  "themeColor": "#FFFFFF",
  "navigationColor": "#000000",
  "navigationColorDark": "#000000",
  "navigationDividerColor": "#000000",
  "navigationDividerColorDark": "#000000",
  "backgroundColor": "#FFFFFF",
  "enableNotifications": true,
  "startUrl": "/",
  "iconUrl": "https://facpro.web.app/logo512.png",
  "maskableIconUrl": "https://facpro.web.app/maskable_icon_x512.png",
  "splashScreenFadeOutDuration": 300,
  "signingKey": {
    "path": "/path/to/android.keystore",
    "alias": "android"
  },
  "appVersionName": "1",
  "appVersionCode": 1,
  "shortcuts": [],
  "generatorApp": "bubblewrap-cli",
  "webManifestUrl": "https://facpro.web.app/manifest.json",
  "fallbackType": "customtabs",
  "features": {},
  "alphaDependencies": {
    "enabled": false
  },
  "enableSiteSettingsShortcut": true,
  "isChromeOSOnly": false,
  "orientation": "default",
  "fingerprints": [],
  "additionalTrustedOrigins": [],
  "retainedBundles": [],
  "appVersion": "1"
}
manifest.json

{
  "short_name": "FACPRO",
  "name": "FACPRO - Faculty Research Progress",
  "icons": [
    {
      "src": "favicon.ico",
      "sizes": "64x64 32x32 24x24 16x16",
      "type": "image/x-icon"
    },
    {
      "src": "logo192.png",
      "type": "image/png",
      "sizes": "192x192"
    },
    {
      "src": "logo512.png",
      "type": "image/png",
      "sizes": "512x512"
    },
    {
      "src": "maskable_icon_x512.png",
      "type": "image/png",
      "sizes": "512x512",
      "purpose": "any maskable"
    }
  ],
  "start_url": ".",
  "display": "standalone",
  "theme_color": "#ffffff",
  "background_color": "#ffffff"
}

您需要將如下內容添加到https://example.com/.well-known/assetlinks.json

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "com.example",
    "sha256_cert_fingerprints":
    ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"]
  }
}]

參考: https ://developer.android.com/training/app-links/verify-site-associations

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM