我正在尝试查看是否可以更新移动应用程序图标图像,而无需再次打开该页面。动态更新ios从网络应用程序中的苹果触摸图标
我的演示是在这里:http://charliehield.com/sandbox/IconUpdate
步骤1:导航到iOS设备上的URL(没有测试Android的,但应该工作)
步骤2:单击箭头按钮,然后选择“添加到主屏幕“
第3步:点击”添加“按钮
现在,图标应该是绿色的。
我使用简单的PHP if语句进行测试,设置$ i = 0;
所以,如果$ I = 0,将苹果触摸图标GREEN.png,否则使用RED.png
这里是我的PHP代码:
<?php $i = 0; ?>
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>IconUpdate</title>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" media="all" href=""/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!-- Adding "maximum-scale=1" fixes the Mobile Safari auto-zoom bug: http://filamentgroup.com/examples/iosScaleBug/ -->
<?php
if ($i == 0) {
echo '<link rel="apple-touch-icon-precomposed" href="green.png">';
} else {
echo '<link rel="apple-touch-icon-precomposed" href="red.png">';
}
?>
</head>
<body lang="en">
add to home screen for DEMO
</body>
</html>
的方式,作品,是我可以手动更改$ i,如果它不= 0,我点击图标,在移动Safari中打开页面,然后按主页按钮,图标将是RED.png
我是想知道是否有办法“推”(因为缺少一个更好的词)新的家庭图标屏幕无需重新打开页面?这可以做到吗?
任何想法和建议?
是啊,我已经做了这一点。理想情况下,我想要更改不必打开应用程序。这在目前是不可能的。 – stursby