18 July 2008

Apple iPhone 2.0: The real story behind MobileMe Push Mail and Jabber/XMPP Chat

So those of you who anticipated a Jabber/XMPP chat client on the iPhone (and iPod Touch) after TUAW rumoured that 'a new XMPP framework has been spotten(sic) in the latest iPhone firmware' back in April were close... but no cigar. Same applies for those who hypothesised about P-IMAP or IMAP IDLE being used by MobileMe for push mail.

The real story, as it turns out, is that Jabber (the same open protocol behind many instant messaging networks including Google Talk) is actually being used for delivering push mail notifications to the iPhone. That's right, you heard it here first. This would explain not only why the libraries were curiously private (in that they are not exposed to developers) but also why IMAP IDLE support only works while Mail.app is open (it's a shame because Google Apps/Gmail supports IMAP IDLE already).

While it's in line with Apple's arguments about background tasks hurting user experience (eg performance and battery life), cluey developers have noted that the OS X (Unix) based iPhone has many options to safely enable this functionality (eg via resource limiting) and that the push notification service for developers is only a partial solution. It's no wonder though with the exclusive carrier deals which are built on cellular voice calls and SMS traffic, both of which could be eroded away entirely if products like Skype and Google Talk were given free reign (presumably this is also why Apple literally hangs onto the keys for the platform). If you want more freedom you're going to have to wait for Google Android, or for ultimate flexibility one of the various Linux based offerings. We digress...

So without further ado, here's the moment we've all been waiting for: a MobileMe push mail notification (using XMPP's pubsub protocol) from aosnotify.mac.com:5223 over SSL:


<message from="pubsub.aosnotify.mac.com" to="samnsofi@aosnotify.mac.com/5e60ad2e47da9fca36de59244f25c9b1cd8e0cb8" id="/protected/com/apple/mobileme/samnsofi/mail/Inbox__samnsofi@aosnotify.mac.com__3gK4m">
<event xmlns="http://jabber.org/protocol/pubsub#event">
<items node="/protected/com/apple/mobileme/samnsofi/mail/Inbox">
<item id="5WE7I82L5bdNGm2">
<plistfrag xmlns="plist-apple">
<key>maild</key>
<string>E1B537</string>
</plistfrag>
</item>
</items>
</event>
<x xmlns="jabber:x:delay" stamp="2008-07-18T01:11:11.447Z"/>
</message>

<message from="pubsub.aosnotify.mac.com" to="samnsofi@aosnotify.mac.com/5e60ad2e47da9fca36de59244f25c9b1cd8e0cb8" id="/protected/com/apple/mobileme/samnsofi/mail/Inbox__samnsofi@aosnotify.mac.com__NterM">
<event xmlns="http://jabber.org/protocol/pubsub#event">
<items node="/protected/com/apple/mobileme/samnsofi/mail/Inbox">
<item id="8ATABX9e6satO6Y">
<plistfrag xmlns="plist-apple">
<key>maild</key>
<string>544FE17</string>
</plistfrag>
</item>
</items>
</event>
<headers xmlns="http://jabber.org/protocol/shim">
<header name="pubsub#subid">3DEpJ055dXgB2gLRTQYvW4qGh91E36y2n9e27G3X</header>
</headers>
</message>
I'll explain more about the setup I used to get my hands on this in another post later on. So what's the bet that this same mechanism will be used for the push notification service to be released later in the year?

4 comments:

kellogs said...

great article .. but not that great , at least not for me. Because I have been struggling for about 2 weeks to get my hackintosh up and running, and now I find out that there is no darn XMPP library available for coders arround the world. So I cant write my app for iphone and make part of my great system putting together Androids, MIDPs and ... sigh ... iPhones. Or can I ?

I am all newb to the green Apple world. Rumours say that you can run code other than objective-c on an iphone. Is there any chance I could port some C / C++ library to iphone, and then call some functions I need from the allmighty objective-c ?

Thanks,
kellogs

Thomas Deniau said...

Did you try to send such messages to simulate push e-mail on a non-MobileMe address ?

I'd love to mod the Dovecot LDA to get push mail on my iPhone :-)

Sam Johnston said...

So what I was hoping for was that the notifications would specify which account to poll (eg MobileMe or Yahoo!). I'd intended then to sit in the middle of the SSL connection and send notifications for 'Google Apps', but now I see it uses XMPP pubsub it seems likely the iPhone will only want to hear about events it's actually listening for.

That's not the news you wanted, but it's not the news I wanted either... wouldn't be a problem with more open platforms like Android.

Sam

mike cole said...

Brand new mobile phone , laptop , come with complete accessories with one year international warranty.

Emaill address: camr_inc@hotmail.com

Samsung armai P520 ......$400usd
Apple iphone 3G 16gb........$300usd
Sony ericsson C905.........$500usd
HTC Touch Pro ..........$500usd
Samsung omnia i900.....$500usd
HTC Touch Diamond ...$350usd
Nokia n96 16gb...$500usd
Apple iphone 16gb..$350usd
Sony ericsson xperia x1..$400usd
Apple iphone 8gb.....$300usd
Nokia n95 8gb.......$300usd
Ps3 60gb.............$300usda

Samsung armai P52 Specifications:

Network: Triband GSM with EDGE
Size: 88 x 54 x 8.9 mm
Weight: 102 grams
Display Screen: QVGA touchscreen, 262k colors, around 2.6-inch
3 megapixel camera
50MB internal memory
microSD card slot
Bluetooth (A2DP capable)
WiFi with UMA
Document viewer
960mAh battery
Up to 180 minutes talk time
Up to 220 hours standby time

We make shipment via Ups and Fedex shipping company 2days deliver worldwide.
If you are interested in buying our product contact us via

Email address: camr_inc@hotmail.com

Post a Comment