3

Is it possible to push update on the favicon (ex. apple-touch-icon.png) on a web-mobile app for iOS? I mean, I saw a weather app that uses the actual app icon to update the temperature...

is it possible in your html5 web app (saved to your home screen)?

to be precise i just saw it working on this web app: pattern.dk/sun and their icon displays exactly the realtime temperature, is that just a trick maybe??

UPDATE The icon doesn't really update in real-time but only when you open and closes the app. still interesting though.

4

2 回答 2

2

I think I found the trick

i'm adding a time stamp to the icon filename like:

    <link rel="apple-touch-icon-precomposed" href="favicon.png?<?php echo $date->format('U'); ?>" /> 
//this is a PHP piece of code but you generat a timestamp in any way you want

so anytime you open the boomark the icon app refresh itself

于 2013-03-29T21:52:19.247 回答
0

从 iOS 7.1 开始,即使文件名相同,Web 应用程序图标也会更新。

于 2014-04-09T18:58:18.057 回答