H5 应用封装成 ios app(PWA ),无需开发者账号。

ios提供了PWA支持,通过manifest.json来配置具体属性,包含应用名称,应用图标等。具体示例如下:

1. 在h5 首页中加入 manifest

<!DOCTYPE html>
<html lang="en" class="no-js no-webp">
<head>

    <title>roots</title>
    <link rel="manifest" href="/site.webmanifest">

2. 首页同级目录中添加 site.webmanifest文件,文件内容如下:

{
  "background_color": "#ffffff",
  "description": "ddd.",
  "display": "standalone",
  "icons": [
    {
        "src": "icon/icon192.png",
        "sizes": "192x192",
        "type": "image/png",
        "purpose": "any"
    },
    {
        "src": "icon/icon196.png",
        "sizes": "196x196",
        "type": "image/png",
        "purpose": "maskable"
    },
    {
        "src": "icon/icon256.png",
        "sizes": "256x256",
        "type": "image/png",
        "purpose": "any"
    },
    {
        "src": "icon/icon512.png",
        "sizes": "512x512",
        "type": "image/png",
        "purpose": "any"
    }
],
  "name": "ddd",
  "prefer_related_applications": false,
  "scope": "/",
  "short_name": "name",
  "start_url": "/?source=pwa",
  "theme_color": "#ffffff"
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值