Technically, a dynamic icon isn't possible! I'd guess @Jakob Henner is manipulating the fact that iOS uses a screenshot of the app for the homescreen icon if there isn't one explicitly set. Am I close? :)
By the way, I've been using this app for a while. Big fan, great work!
(I can't get the new version to show up on my iPad, only my iPhone. Is that a bug, or is only the iPhone version updated?)
The Dynamic icon is pretty easy, they just render the icon using canvas and set the resulting image (using .toDataURL) into the head via a link. Something like:
Not so fast, @Bruno Lazzaro! Once you save an app to your homescreen, Apple caches the icon. It doesn't update with every app load. You'd need to delete the app and re-add it to the homescreen to get the updated icon.
Actually, @Bruno Lazzaro is right. You can set the icon within one second of app launch. After a second, you have to use some kind of server scripting.
What! Mind: blown. Is there any documentation about this? I've never seen anyone talk about it being possible, and I've never been able to make it work in my own testing.
@Samuel Fine While "technically" it is dynamic, it isn't dynamic in the way it needs to be. Meaning it doesn't display up-to-date information without opening the app first to refresh the icon.
23 Responses
Pro
Jakob Henner
Sun now sports a dynamic icon, reflecting the current weather.
Try Sun on pattern.dk/sun from your iOS device.
3 months ago
Pro
lukechesser
Incredible work. Would love to see a blog post on the method for updating the icon. I haven't seen anyone do anything like this before.
3 months ago
pretty dope, mate!
3 months ago
Incredible. Another reason why web apps ROCK
3 months ago
Can you share how you dynamically change the icon?
3 months ago
so good
3 months ago
Pro
Martijn Otter
That icon looks so cool! Great colors!
3 months ago
Didn't know this was possible (dynamic icon). Awesome!
3 months ago
Pro
Simen Myklebust
Wow, this beats all weather apps! The new dynamic icon is awesome! *added to iphone front page*
3 months ago
Pro
Simen Myklebust
Thumbs up for using data from yr.no
3 months ago
Pro
serhat ozirik
Super!
3 months ago
Pro
Laurent Sutterlity
Pretty nice app :)
3 months ago
Pro
Samuel Fine
Technically, a dynamic icon isn't possible! I'd guess @Jakob Henner is manipulating the fact that iOS uses a screenshot of the app for the homescreen icon if there isn't one explicitly set. Am I close? :)
By the way, I've been using this app for a while. Big fan, great work!
(I can't get the new version to show up on my iPad, only my iPhone. Is that a bug, or is only the iPhone version updated?)
3 months ago
Is it possible to improve the opening time of the app?
Design-wise is an awesome work!
3 months ago
Pro
Martin Kool
That is bloody sweet! Very clever!
3 months ago
Pro
Samuel Fine
Never mind! iPad is working now. :)
3 months ago
The Dynamic icon is pretty easy, they just render the icon using canvas and set the resulting image (using .toDataURL) into the head via a link. Something like:
$('head').append('<link id="icon" rel="apple-touch-icon-precomposed" href="icon-' + variant + '.png" />');
Would do the trick.
3 months ago
Pro
Samuel Fine
Not so fast, @Bruno Lazzaro! Once you save an app to your homescreen, Apple caches the icon. It doesn't update with every app load. You'd need to delete the app and re-add it to the homescreen to get the updated icon.
3 months ago
Pro
Jakob Henner
@Samuel Fine,
Actually, @Bruno Lazzaro is right. You can set the icon within one second of app launch. After a second, you have to use some kind of server scripting.
3 months ago
Pro
Samuel Fine
What! Mind: blown. Is there any documentation about this? I've never seen anyone talk about it being possible, and I've never been able to make it work in my own testing.
3 months ago
Pro
Paul Kelley
@Samuel Fine While "technically" it is dynamic, it isn't dynamic in the way it needs to be. Meaning it doesn't display up-to-date information without opening the app first to refresh the icon.
3 months ago
Really awesome work.
3 months ago
Pro
Chris Allen
Sun is the best web app I've ever come across. Simply stunning work. Did you code this yourself?
3 months ago