August,

Just to second what Randy said...

Agreed on the general rule of thumb of using object detection and
avoiding user agent detection for Web sites. However, if you are
developing an application specifically for iPhone/iPod, then user
agent detection is a valid way to go. Plus, since an iPhone app is
written for a particular viewport (and might rely on iPhone service
integration), then searching for "iPhone" (and/or "iPod") is preferred
over "Mobile" and "Safari". After all, they could release a iWidePod
that had completely different viewport dimensions.

 - Rich

On Sep 15, 3:10 pm, Randy Walker <[EMAIL PROTECTED]> wrote:
> Yes, Apple could release a new device tomorrow.  This device could  
> also have Mobile Safari.  It could also be yet a different version of  
> Safari to take advantage of whatever hardware capabilities this "new"  
> device may or may not have in common with iPod touch or existing  
> iPhones.  I would think checking for just 'mobile' and 'safari' will  
> cause you many more headaches than checking for those AND the device  
> name as well.  I've seen more than one article stating that Phone &  
> iPod touch already have dif versions (builds) of safari, even though  
> they are both called mobile.  Who knows if they will ever be exactly  
> the same?
>
> -=Randy
>
> On Sep 15, 2007, at 5:00 AM, August Trometer <[EMAIL PROTECTED]> wrote:
>
>
>
> > Actually, checking the user-agent string against the device is the
> > wrong thing to do. What if Apple released an iTablet with Safari
> > tomorrow? Or what if they license Safari to another device
> > manufacturer? Then we'd all be back changing our code.
>
> > Instead, look for the words "Mobile" and "Safari." Apple has said that
> > these will always be in the Safari user-agent string for mobile  
> > devices.
>
> > if ((navigator.userAgent.indexOf('Mobile') != -1 &&
> > (navigator.userAgent.indexOf('Safari') != -1 {
>
> >    // do stuff here
> > }
>
> > -- August
>
> > On Sep 14, 2007, at 5:52 PM, Greg McGuinness wrote:
>
> >>> The iPod Touch user agent string is similar to the iPhone except:
> >>> - it says "iPod" instead of "iPhone"
> >>> - AppleWebKit is 420.1 rather than 420+
> >>> - "3A100a" Safari rather than "1C28 Safari" on the iPhone.
>
> >> if ((navigator.userAgent.indexOf('iPhone') != -1) ||
> >> (navigator.userAgent.indexOf('iPod') != -1)) {
> >> document.location = "iphonerevu.htm";
> >> }
>
> >> I just posted this at:
> >>http://groups.google.com/group/iphonewebdev/browse_thread/thread/
> >> e12db4b239e6319d/db564932bfa220a6#db564932bfa220a6
>
> >> and have pictures of the new Developer Console at:
>
> >>http://www.iphoneapps.com/2007/09/ipod-touch-developer-debug-console.asp
>
> >> Greg McGuinness
> >> mailto:[EMAIL PROTECTED]
>
> >> On Sep 14, 2007, at 5:27 PM, Dennis Baldwin wrote:
>
> >>> I second that notion.  I would love to know as well.  For my iPhone
> >>> it looks like the following:
>
> >>> Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+
> >>> (KHTML, like Gecko) Version/3.0 Mobile/1C28 Safari/419.3
>
> >>> I'm wondering if the touch will have the "Mobile" part of the user
> >>> agent string or what the differentiation will be.  If you do have a
> >>> touch feel free to go to:
>
> >>>http://iphone.ublip.com/user_agent.php
>
> >>> and post your results here.
>
> >>> Thanks,
> >>> Dennis
>
> >>> On 9/14/07, rich_wagner <[EMAIL PROTECTED]> wrote:
>
> >>> Actually, thinking more about this...it seems like one would want
> >>> actually expect the platform string to be unique to each device in
> >>> order to differentiate between them. For example, you would not want
> >>> an iPod touch device to try a tel: link.
>
> >>> On Sep 14, 1:28 pm, rich_wagner < [EMAIL PROTECTED]> wrote:
> >>>> If anyone has an iPod touch, I am curious what the user agent is  
> >>>> and
> >>>> whether "iPhone" appears in the platform string or whether it is
> >>>> specific to "iPod touch". My hunch is that they'll maintain  
> >>>> 'iPhone"
> >>>> for consistency and since the Mobile Safari browser will surely be
> >>>> identical for both devices.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to