Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-12-22 07:52:35

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

what size favicon for mobile devices?

Mobile devices use different size favicons and I’m lost regarding the apple ones.

In the oreilly site it says:

Up to iOS 3.1 (known as iPhone OS at that time), 57×57 pixels was the only available size for the WebClip. Starting with iOS 3.2 for iPad, 72×72 is the icon size we should use if we detect this device. For iOS 4.0 or newer, devices with high DPIs (such as iPhone 4) need an icon size of 114×114 pixels. Otherwise, the device will resize the icon with quality loss.

so we have

  • 57×57
  • 72×72
  • 114×114

and only one code: <link rel="apple-touch-icon" href="iphone_icon.png" />

How can I create native favicons for all apple mobile devices?

Last edited by colak (2010-12-22 07:53:35)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#2 2010-12-22 09:05:56

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,538
Website GitHub Twitter

Re: what size favicon for mobile devices?

Hi Colak

I have nothing to know about ios, but googling give those code:

here
here
and here

The code is a php code.

Cheers

Offline

#3 2010-12-22 09:33:59

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

Re: what size favicon for mobile devices?

There was an article detailing some of this and more related info on 24ways just a few days ago: life beyond media queries. In that they show an additional attribute sizes="114x114". I guess that means the following:

<link rel="apple-touch-icon" href="apple-touch-icon-iphone.png" />
<link rel="apple-touch-icon" sizes="72x72" href="apple-touch-icon-ipad.png" />
<link rel="apple-touch-icon" sizes="114x114" href="apple-touch-icon-iphone4.png" />

BTW, if you’re also tailoring your site to different viewport dimensions, you might also find the recommendations in the less framework interesting.


TXP Builders – finely-crafted code, design and txp

Offline

#4 2010-12-22 09:36:22

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: what size favicon for mobile devices?

Hi Dragondz,
Thanks so according to this and my ignorance with php could the code be

<txp:php>
float version = [[[UIDevice currentDevice] systemVersion] floatValue];
if (version > 3.2)
{
   <link rel="apple-touch-icon" href="/mobile/3/iphone_icon.png" />
}
else if (version < 4.2)
{
    <link rel="apple-touch-icon" href="/mobile/4/iphone_icon.png" />
}
else if (version > 4.1999)
{
    <link rel="apple-touch-icon" href="/mobile/42/iphone_icon.png" />
}

</txp:php>


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2010-12-22 09:42:30

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: what size favicon for mobile devices?

jakob… will try your way first.
simpler and cleaner… I guess:)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#6 2010-12-22 12:49:14

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,196
Website

Re: what size favicon for mobile devices?

jakob wrote:

<link rel=“apple-touch-icon” href=“apple-touch-icon-iphone.png” />
<link rel=“apple-touch-icon” sizes=“72×72” href=“apple-touch-icon-ipad.png” />
<link rel=“apple-touch-icon” sizes=“114×114” href=“apple-touch-icon-iphone4.png” />

That is the recommended code suggested by Apple


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#7 2010-12-22 17:12:11

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: what size favicon for mobile devices?

that’s it!

thank you all soo much!


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#8 2010-12-27 09:56:27

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: what size favicon for mobile devices?

Well… The code does not validate on xhtml but validates in html 5. As my sites are xhtml I scouted the net for some code to make the rel links invisible to non mobile browsers.

would this work or does anyone know of a better method ?

<txp:php>
    $iphone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
    $android = strpos($_SERVER['HTTP_USER_AGENT'],"Android");
    $palmpre = strpos($_SERVER['HTTP_USER_AGENT'],"webOS");
    $ipod = strpos($_SERVER['HTTP_USER_AGENT'],"iPod");
    $ipad = strpos($_SERVER['HTTP_USER_AGENT'],"iPad");
    if(!$iphone && !$android && !$palmpre && !$ipod && !$ipad) {
    echo '<link rel="apple-touch-icon" href="/touch-icon-iphone.png" />
<link rel="apple-touch-icon" sizes="72x72" href="/touch-icon-ipad.png" />
<link rel="apple-touch-icon" sizes="114x114" href="/touch-icon-iphone4.png" />'; 
	}
</txp:php>

many thanks


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#9 2010-12-28 13:49:10

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: what size favicon for mobile devices?

act_if_mobile does the job


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB