创建React App iOS添加到主屏幕显示白页

问题描述 投票:1回答:1

我有一个带有create-react-app的react应用,我想让用户可以将其添加到主屏幕。

这是我的清单文件:

{
  "short_name": "React App",
  "name": "React App",
  "icons": [
    {
      "src": "favicon.ico",
      "sizes": "64x64 32x32 24x24 16x16",
      "type": "image/x-icon"
    }
  ],
  "start_url": ".",
  "display": "standalone",
  "theme_color": "#000000",
  "background_color": "#ffffff"
}

[当我将该应用添加到iOS的主屏幕并打开它时,它将显示空白页面。如果我在野生动物园中打开它,效果很好。有谁知道为什么会这样?

javascript ios safari create-react-app progressive-web-apps
1个回答
0
投票

也正在研究避免此问题的最佳方法。现在,我发现了这一点:https://ayastreb.me/react-router-in-home-screen-pwa/

基本上使用哈希路由。

© www.soinside.com 2019 - 2024. All rights reserved.