渐进式web应用程序

添加到主屏幕 (Add To Homescreen)

Here the web app install banner is focused on web app, with the feature of add to homescreen.

在此,Web应用程序安装标语专注于Web应用程序,具有添加到主屏幕的功能。

浏览器对“添加到主屏幕”的支持 (Browser Support for Add To Homescreen)

Add to Homescreen functionality is currently supported by:

当前受“添加到主屏幕”功能的支持:

  • ChromeChrome
  • iOS SafariiOS Safari

You can see the latest status of browser support of this feature here.

您可以在此处查看该功能的浏览器支持的最新状态。

在Android上 (On Android)

On Android, the “add to homescreen” banner comes up automatically if you meet certain requirements. This is what it should look like on Android:

在Android上,如果您满足某些要求,则会自动显示“添加到主屏幕”横幅。 这是在Android上的外观:

Add to homescreen promptWhen app launched

添加到主屏幕提示应用启动时

要求 (Requirements)

include a manifest.json file with the following properties:

包含具有以下属性的manifest.json文件:

  • short name

    short name

  • name

    name

  • 192x192 size of png icon

    192x192大小的png图标

  • start_url

    start_url

  • include a service worker that is both registered and activated包括已注册和激活的服务人员
  • the website served over HTTPS (you can still try this with localhost without HTTPS)该网站通过HTTPS提供服务(您仍然可以在没有HTTPS的情况下使用localhost尝试此操作)
  • the website meets engagement heuristics defined by Chrome该网站符合Chrome定义的互动启发法

manifest.json (manifest.json)

{"name": "FreeCodeCamp","short_name": "FreeCodeCamp","theme_color": "#00FF00","background_color": "#00FF00","display": "standalone","Scope": "/","start_url": "/","icons": [{"src": "assets/images/icons/icon-72x72.png","sizes": "72x72","type": "image/png"},{"src": "assets/images/icons/icon-96x96.png","sizes": "96x96","type": "image/png"},{"src": "assets/images/icons/icon-128x128.png","sizes": "128x128","type": "image/png"},{"src": "assets/images/icons/icon-144x144.png","sizes": "144x144","type": "image/png"},{"src": "assets/images/icons/icon-152x152.png","sizes": "152x152","type": "image/png"},{"src": "assets/images/icons/icon-192x192.png","sizes": "192x192","type": "image/png"},{"src": "assets/images/icons/icon-384x384.png","sizes": "384x384","type": "image/png"},{"src": "assets/images/icons/icon-512x512.png","sizes": "512x512","type": "image/png"}],"splash_pages": null
}
  • name is the name of the web app. (It will be shown in the launch screen)

    name是网络应用程序的名称。 (它将显示在启动屏幕中)

  • short name is the short name of the web app. (It will be shown below the icon of phone menu)

    short name是Web应用程序的简称。 (它将显示在电话菜单图标下方)

  • theme_color is the color of the top of the browser.

    theme_color是浏览器顶部的颜色。

  • background_color is the background color of the launch screen.

    background_color是启动屏幕的背景色。

  • display is the way the web app should display once launched on the phone.

    display是网络应用在手机上启动后应显示的方式。

  • start_url define the starting url of the website.

    start_url定义网站的起始URL。

  • icons is an array that store all the images location, sizes and type.

    icons是一个数组,用于存储所有图像的位置,大小和类型。

在其他设备上 (On other devices)

Although this method does not work on iOS and Windows, there is a fallback method.

尽管此方法在iOS和Windows上不起作用,但是有一个备用方法。

的iOS (iOS)

On iOS, the “add to homescreen” button must be added manually. Add the following meta tags to the head section of your HTML to support iOS web app icon.

在iOS上,必须手动添加“添加到主屏幕”按钮。 将以下元标记添加到HTML的头部,以支持iOS Web应用程序图标。

<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="green">
<meta name="apple-mobile-web-app-title" content="FreeCodeCamp">
<link rel="apple-touch-icon" href="/assets/images/icons/icon-72x72.png" sizes="72x72">
<link rel="apple-touch-icon" href="/assets/images/icons/icon-96x96.png" sizes="96x96">
<link rel="apple-touch-icon" href="/assets/images/icons/icon-128x128.png" sizes="128x128">
<link rel="apple-touch-icon" href="/assets/images/icons/icon-144x144.png" sizes="144x144">
<link rel="apple-touch-icon" href="/assets/images/icons/icon-152x152.png" sizes="152x152">
<link rel="apple-touch-icon" href="/assets/images/icons/icon-192x192.png" sizes="192x192">
<link rel="apple-touch-icon" href="/assets/images/icons/icon-384x384.png" sizes="384x384">
<link rel="apple-touch-icon" href="/assets/images/icons/icon-512x512.png" sizes="512x512">

视窗 (Windows)

On windows phone, add the following meta tags to the head section of your HTML:

在Windows Phone上,将以下元标记添加到HTML的头部:

<meta name="msapplication-TileImage" content="/assets/images/icons/icon-144x144.png">
<meta name="msapplication-TileColor" content="green">

翻译自: https://www.freecodecamp.org/news/how-to-add-to-homescreen-in-a-progressive-web-app/

渐进式web应用程序

渐进式web应用程序_如何在渐进式Web应用程序中添加到主屏幕相关推荐

  1. html5横幅添加搜索,html5 – 为什么我的“添加到主屏幕”Web应用程序安装横幅未显示在我的网络应用程序中...

    首先,让我们检查您的清单是否满足显示Web App安装横幅的要求. 要求 显示Web App安装横幅的完整(当前)要求是*: >拥有一个Web应用程序清单文件: >一个short_name ...

  2. 苹果IOS在Safari浏览器中将网页添加到主屏幕做伪Web App,自定义图标,启动动画,自定义名称,全屏应用

    在ios中我们可以使用Safari浏览自带的将网页添加到主屏幕上,让我们的web页面看起来像一个本地应用程序一样,通过桌面APP图标一打开,直接全屏展示,就像在APP中效果一样,完全体会不到你是在浏览 ...

  3. 微信小程序怎么添加到主屏幕将微信小程序放到手机桌面?

    微信小程序在一些场景下使用还是非常方便,如果遇到需要经常使用的微信小程序,将该微信小程序添加到手机桌面上,下次直接点击打开将更方便. 例如:草柴微信小程序很多人每天都在用免费领取美团外卖红包优惠券.饿 ...

  4. 百度小程序怎么添加到主屏幕将百度小程序放到手机桌面?

    百度小程序在一些场景下使用还是非常方便,如果遇到需要经常使用的百度小程序,将该百度小程序添加到手机桌面上,下次直接点击打开将更方便. 例如:草柴百度小程序很多人都在用每天免费领取美团外卖红包优惠券.饿 ...

  5. 渐进式web应用程序_如何使用渐进式Web应用程序更快,更便宜地构建新应用程序...

    渐进式web应用程序 You need an app! The question is- which kind? 您需要一个应用程序! 问题是--哪种? For the last 8 years or ...

  6. java web应用程序_如何构建Java Web 应用程序 - Spring Boot?

    Spring Framework 是可以帮助 Java 开发人员创建企业级应用程序的开源解决方案.构建在该平台基础之上的较热门项目之一是 Spring Boot,它提供一种简化的方法来创建独立的 Ja ...

  7. 11无监听程序_腾讯开心鼠英语 小程序实践与总结

    腾讯开心鼠英语 团队中有很多小程序的项目,且后续还会很多小程序的开发和迭代规划,因此我们团队是小程序的重度使用者.在小程序的开发中,团队积累了一些技术和经验,也遇到了一些困难和挑战,还踩了很多坑,因此 ...

  8. plsql developer无监听程序_腾讯开心鼠英语 小程序实践与总结

    腾讯开心鼠英语 团队中有很多小程序的项目,且后续还会很多小程序的开发和迭代规划,因此我们团队是小程序的重度使用者.在小程序的开发中,团队积累了一些技术和经验,也遇到了一些困难和挑战,还踩了很多坑,因此 ...

  9. java web认证考试_用Java实现Web服务器HTTP协议

    一.HTTP协议的作用原理 HTTP协议的作用原理包括四个步骤: 1.连接:Web浏览器与Web服务器建立连接.2.请求:Web浏览器通过socket向Web服务器提交请求.3.应答:Web浏览器提交 ...

最新文章

  1. Ubuntu 14.04 opencv 2.4.9 安装
  2. linux用户带密码迁移 LDAP
  3. 基于eclipse RCP的文件夹管理工具
  4. python 函数进度条怎么_python输出结果刷新及进度条的实现操作
  5. 奔驰宝马路虎等齐降价 最高降幅达8.5万!
  6. 在pycharm/IDEA里编辑latex:TeXiFy-IDEA/Pycharm
  7. centos 6 安装clamav杀毒软件查毒
  8. 汉字转16进制java_java中将汉字转换成16进制
  9. 新手如何做抖音直播带货?新号如何快速获取直播推荐流量?
  10. bzoj 1260涂色 题解
  11. Airbnb短租房源数据分析
  12. (已解决)ubuntu16.04蓝牙耳机与电脑配对成功,但不出现在声音输出设备里
  13. matlab gain 可以是负数吗,GAMS不报错,但是得负数,怎么办?
  14. mac 打开Readme.md文件 -- 无需下载软件
  15. 【金融风险管理】python进行股票标准差、方差、均值、离散系数、标准化、对数收益率
  16. Qt Qml 开发超高清视频回放监控客户端
  17. 财务自由人(Financial free man)
  18. 诺基亚n1 android 6.0,数据解读诺基亚N1:安卓平板王者之争
  19. [转载]ExtJs4 笔记(11) Ext.ListView、Ext.view.View 数据视图
  20. 转: 大年三十整理的asp.net资料!(经典)

热门文章

  1. linux终端关闭时为什么会导致在其上启动的进程退出?
  2. 7年老Android一次操蛋的面试经历,深度好文
  3. Spring入门与常用配置
  4. LeetCode Range Sum Query Immutable
  5. jQUery中closest和parents的主要区别是
  6. .NET Framework 工具
  7. android的progressDialog 的使用。android数据异步加载 对话框提示
  8. JAVA获取JVM内存空间和物理内存空间
  9. C# webbrowser 代理
  10. VS2005 ASP.NET2.0安装项目的制作(包括数据库创建、站点创建、IIS属性修改、Web.Config文件修改)