Accessing iPhone built in services from Safari

During the iPhone demo at yesterday’s WWDC keynote, we saw several examples of accessing the iPhone’s built in apps and services. I thought I’d go through the demoed features and break ‘em down a little:

Tap on a phone number to call

This technology dates back to the wtai:// pragma from the WAP/WML dark ages and has since been codified with the tel: uri scheme as outlined in RFC 3966. The tel: scheme is used with XHTML MP and existing mobile browsers (here’s an example from one of Brain Fling’s presentations). I would hope for consistency sake that Apple makes use of tel: but there’s a chance they might go for the unstandardized-but-used-a-lot callto: instead. The callto: scheme is used by Microsoft Netmeeting and Skype on most desktop systems.

Tap on an email address to invoke the native mail client

It’s mailto: folks, let’s move along.

Tap on an address to launch the Google Maps app

I’m assuming that this is being handled via a proprietary URI scheme which the Google Maps app is registered to. I can’t tell you if it’s going to be gmaps:// or something else, but it’s going to be as simple as creating a link to gmaps://q=20+Infinite+Loop+Cupertino,+CA (or something very similar). This functionality is the most intriguing to me as a geowanker, but my gut tells me that it just boils down to a URL scheme.

During the demo, leaving the Google Maps app returned to the home screen instead of going back to Safari, so an extra click was required to get back to the Safari webapp. No big deal, just an interesting tidbit.

So what’s the takeaway for a developer looking to target the iPhone? The long and short of it is that nothing’s really changed since before WWDC. Write yourself a webapp and target the iPhone. What about access to all those built in services and apps? The good news is that it’s nothing special, it’s stuff you’re used to dealing with, and (with the exception of a new uri scheme for Google Maps) there’s really nothing new here. The bad news? It’s nothing special, it’s stuff you’re used to dealing with, and (with the exception of a new uri scheme for Google Maps) there’s really nothing new here.

Update: Apple has released developer notes for the iPhone. The winners are tel:, mailto:, and (interestingly) they’re just hijacking calls to maps.google.com and sending them over to the google maps app.

11 Responses to “Accessing iPhone built in services from Safari”


  1. 1 Rob Goodlatte Jun 12th, 2007 at 12:55 pm

    It would be interesting if they recognized something like Microformats in addition to proprietary standards. Also, for phone numbers they could just use a regular expression checker like the Treo does.

  2. 2 Matt Croydon Jun 12th, 2007 at 1:35 pm

    Rob,

    Indeed! Good call.

  3. 3 Kev Jun 13th, 2007 at 9:57 pm

    If Safari is the platform, then Apple also needs to give out CSS styles, icons, backgrounds, etc to match the iPhone look. Otherwise there’s going to be a hodgepodge.

    It’s just common sense.

  4. 4 Dudley Jun 14th, 2007 at 4:29 am

    Rob, while microformats are fine and good, I greatly dislike the idea of a regex checker. Nothing but nothing about a browser, should automatically scan through your webpage and alter the page, purely to add something the developer did not intend. A good developer should all the phone link themselves. We don’t rightly know where Flash stands, but honestly, I feel strongly that developers have fallen asleep MOSTLY because of lame, crippled, browsers on mobile phones (like the Treo).

    Does anyone realize you can reproduce the game Wolfenstein 3D or Doom in Safari, right now, with sounds and animation, without using Flash? I mean, IE has really blinded people to what can be done inside a browser today. Parallax scrolling, bezier curves, etc. I agree with Kev though. Scott Forstall, as VP of platform experience, should be “helping” people along by giving out DEV “packs” of graphics, etc. I didn’t attend WWDC, so maybe they wanted very badly to give developers bang for their buck without completely sharing it with the world too quickly.

    I’m personally hoping it might be possible to specify or automatically understand the orientation of the screen on the iPhone. I’m sure Window size would do it, but it’d be great if Safari let off an “event” when the browser orientation is changed.

    http://developer.mozilla.org/en/docs/Category:Canvas_examples

  5. 5 Kevin Jun 15th, 2007 at 2:31 pm

    Just a note. On Windows CE devices, when you change the screen orientation, the browser sends a normal window resize event. This makes perfect sense.

    We use this in our internal web applications… depending on orientation, our menus either are at the bottom (portrait mode) or on the side (landscape mode).

    Regards.

  6. 6 Rich Jun 25th, 2007 at 1:43 pm

    Just wondering, is there a simple way to determine whether or not the browser rendering your page understands the different schemes (”tel:…” or “gmaps:…”).

    I’d like to take advantage of these if the browser supports it, but leave telephone numbers “as is” (purely static text) if the browser will not know how to handle it.

    I was poking around and couldn’t find a way in JavaScript to determine browser support for a given scheme. Any ideas?

  7. 7 xeegvhyylb Jun 26th, 2007 at 2:23 pm

    Hello! Good Site! Thanks you! rtvjxpnbvq

  8. 8 Jeff Croft Jul 4th, 2007 at 10:46 am

    Matt, I noticed Apple also hijacks links to youtube.com and opens the YouTube app. I think both this and the Google Maps bit is pretty smart, UI-wise. The built-in apps are clearly better experiences on the iPhone than going to those websites would be.

  1. 1 Manas Trackback on Jun 12th, 2007 at 5:54 pm
  2. 2 The reason for no iPhone SDK, Apple makes money from iTunes « Put Together Quickly by Michael Biven Pingback on Jun 18th, 2007 at 10:51 am
  3. 3 mulacorulafaxekucn Trackback on Jul 28th, 2007 at 3:51 am

Leave a Reply