H5 应用封装成 ios app(PWA ),无需开发者账号。
ios提供了PWA支持,通过manifest.json来配置具体属性,包含应用名称,应用图标等。具体示例如下:1. 在h5 首页中加入 manifest2. 首页同级目录中添加 site.webmanifest文件,文件内容如下:
·
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"
}
更多推荐
已为社区贡献3条内容
所有评论(0)