Create an ‘iMessage Me’ link

With the launch of iMessage on the Mac earlier this month, we now have what I think to be the perfect IM solution – cross device (not platform, sadly) syncing of message histories – why couldn’t anyone do this earlier?

You may like to add an iMessage Me link to your website/blog to make it easier for people visiting your page from a Mac or iOS device (iPhone, iPad, iPod touch) – just a tap and they’re all set to iMessage you.

For whatever reason, iOS and OS X use different URL schemes for iMessage – I understand why Messages for Mac may not want to adopt the sms:┬áscheme, but I find it odd that iOS doesn’t like the imessage: scheme. So we’re left with two different schemes depending on the platform your visitor is using.

Using some fancy PHP trickery, here’s some code that will detect your visitor’s operating system, and based on that display either a sms: link or an imessage: one.
[crayon lang="php"]sms[/crayon]
Throw this inbetween your standard link and you’re good to go.

For example:

[crayon lang="html"]iMessage me![/crayon]

Or, put together:

[crayon lang="html"]iMessage me![/crayon]

And in action:
iMessage me!

Tapping/clicking on this will bring up the Messages app on either platform with your email address pre-filled. Nifty.

And if you’re not on an iPhone with iOS 5 installed, or some other handset, this should bring up an MMS window with your email address pre-filled too.

Comments

  1. Vic says

    have you thought about making a full html code for this, php for some reason won’t work with a dropbox public site. could you possibly write a code for me that does
    <a href=":youremail@email.com”>

    • Beau Giles says

      Hey Vic;
      Unfortunately PHP is used here to detect whether the user is on a Mac or iOS device, and then change the URL to suit.

      You can use a href=sms:email@email.com or a href=imessage:email@email.com but remember that the SMS link only works on iOS, and the iMessage link only works on the Mac; it’ll throw up an error on iOS.

  2. Nic says

    Is it possible that it activate a message and send to us?

    E.g. When a user directly click on the link, it will send us notification automatic on clicking and we can start the conversation. Probably with a custom message. Possible?

Trackbacks