PWA not opening in full screen mode on iphone/ipad

风格不统一 提交于 2021-01-27 16:09:17

问题


I went through several articles related to PWA on ios but still not able to figure out why I am seeing address bar after adding an app to the home screen. I would be glad if someone could help me with this.

meta tags in my index file

  <meta charset="UTF-8">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="mobile-web-app-capable" content="yes">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="manifest" href="./assets/manifest.json">
  <meta name="theme-color" content="#ffffff">

Manifest File

{
    "short_name": "Dashboard",
    "name": "Dashboard",
    "icons": [
      {
        "src": "logo.png",
        "sizes": "512x512",
        "type": "image/png"
      }
    ],
    "start_url": "/home",
    "display": "standalone",
    "theme_color": "#000",
    "background_color": "#000"
  }

回答1:


In case anyone stumble on this article. As of 04-2020 iOS does not read the manifest file to set the PWA screen mode. Instead one needs to add their meta tags:

<meta name="apple-mobile-web-app-capable" content="yes">

For viewing the app in full screen mode. And:

<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">

For setting the status bar the same color as page <body>. There are other options available: black and white.



来源:https://stackoverflow.com/questions/53061258/pwa-not-opening-in-full-screen-mode-on-iphone-ipad

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!