美好生活&吃喝玩乐购

H5免签绿标配置IOS描述文件及网站配置

1、准备工具

1.iPhone 配置实用工具;

2.可运行openssl的服务器(宝塔已经集成了);

3.网站域名已经获得SSL证书;

2、安装Iphone配置实用工具

1.下载iPhone配置实用工具Windows版。

iphone配置实用工具

2.打开后安装(一直下一步就行);

3.如果有提示无法找到apple.mobile.xxxx的提示,安装下面文件。

AppleMobileDeviceSupport64.msi

注:这个文件可以通过右键安装包。用winrar打开

H5免签绿标配置IOS描述文件及网站配置

3、配置描述文件

1.打开IPhone配置实用工具,选择配置描述文件。

H5免签绿标配置IOS描述文件及网站配置

2.点击“通用”,在右侧进行基本信息配置。

名称:设置中显示的名字;

标识符:参考例子com.xxx.xxxx(XXX可写域名或其他英文字母)

机构:设置中显示

描述:设置中显示

安全性:默认即可

自动移除描述文件:永不

H5免签绿标配置IOS描述文件及网站配置

3.点击左侧的Web Clip,进行配置:

标签:手机桌面显示的名字;

URL:网站地址

可删除:默认

图标:上传114*114带背景的PNG图片即可(不然默认是黑底)

预作图标:默认

全屏幕:勾选;

H5免签绿标配置IOS描述文件及网站配置

4.导出 配置文件,配置完成后点击左上方“导出”,在弹出的提示框中选择“无”,最后点击导出。(保存在一个文件夹内便于后续操作)

H5免签绿标配置IOS描述文件及网站配置

5.对配置文件进行“签名”操作

现把域名认证的SSL文件下载下来,最好是Apache格式的;

H5免签绿标配置IOS描述文件及网站配置

一般会有三个文件,把三个文件名改短一些,

www.mhsh.city.key改为abc.key 服务器端用于签名的证书

www.mhsh.city_chain.crt改为ca.crt 链证书 (注意一定钥匙Chain这个改为CA.crt文件)

www.mhsh.city_public.crt改为abc.crt 服务器端用于签名的证书的秘钥

改完后把以上三个文件,加上配置好的描述文件,一起上传到宝塔的任意一个目录下。并且在目录中点击上方终端

H5免签绿标配置IOS描述文件及网站配置

在终端中粘贴以下代码,代码中红色部分要与你的文件名一致。

openssl smime -sign -in mhsh.mobileconfig -out signed.mobileconfig -signer abc.crt -inkey abc.key -certfile ca.crt -outform der -nodetach

运行成功后,刷新文件夹会多出来一个signed.mobileconfig的文件,这个就是签名过的描述文件了。

以上描述文件的配置与签名已经搞定了。下面进行网站的配置;

4、网站配置并解决WebClip自动跳转Safari及头部网址弹出

新建一个网页文件,我这里设置为udid.php,粘贴以下代码

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no" name="viewport" id="viewport" />
<title>下载配置文件</title>
<body>
<div id="content">
<a class="buttons" href="udid.mobileconfig" target="_blank">获取配置文件</a>

</div>
</body>
</html>

代码中href=”udid.mobileconfig” 改为你的配置文件名及路径

然后手机操作,打开网页访问该页面后即可下载。

安装完成后可在手机界面查看到网站图标。

解决自动跳转Safari问题(无需重新生成配置文件

一、将下面代码复制到每个网页的<head >标签中,请务必确保所有网页均写有此代码。

<script>if(("standalone" in window.navigator) && window.navigator.standalone){
	var noddy, remotes = false;
	document.addEventListener('click', function(event) {
		noddy = event.target;
		while(noddy.nodeName !== "A" && noddy.nodeName !== "HTML") {
			noddy = noddy.parentNode;
		}
		if('href' in noddy && noddy.href.indexOf('http') !== -1 && (noddy.href.indexOf(document.location.host) !== -1 || remotes)){
			event.preventDefault();
			document.location.href = noddy.href;
		}
	},false);
}</script>

二、点击网站任意链接会在头部跳出网址,显的不像app一样巨丑

新建文件,粘贴以下代码,重新生成配置文件,并在url中指向到该文件。


<html style="font-size: 96px;">
<head>
<meta http-equiv="Content-Type" content="text/html;" >
<meta http-equiv=" x-ua-compatible"="">
<script>
document.addEventListener('DOMContentLoaded', function() {
    document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
})
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover">
 </head> 
<body scroll="no">
<style mce_bogus="1">
body { margin: 0px;  }
iframe {border: 0px;}
</style>
<iframe id="frame3d" name="frame3d" frameborder="0" width="100%" scrolling="auto" style="margin-top: -4px;" οnlοad="this.style.height=document.body.clientHeight-84" height="100%" src="你的网址" mce_src="你的网址"></iframe> 
</body>

至此已经全部配置完毕

© 版权声明
THE END
喜欢就支持一下吧
点赞15赞赏 分享