Turning the Iphone 3G into an almost useful always-on IM device
Posted by Admin • Saturday, March 14. 2009 • Category: Code and HacksI've had a Blackberry for quite some time now, and came to take for granted the basic ability to be always available via Google Talk, Latitude, email, etc - not to mention have fine-grained control of when I get notified about each one. Running multiple apps (gtalk, maps, ssh, browsers, etc) - was never a problem, and there is even an Alt-Tab equivalent for toggling between running apps. Blackberry even has an integrated push-IM system for Blackberry to Blackberry communication.
All that changed with the IPhone (if it was not paid for, I would never have gotten one, but now I'm trying to make the most of it while saving the money I used to spend on the Blackberry). The IPhone (3G, 2.2.1) proved to be unable to do any of the above well. No mail alerting rules, no running multiple applications !!?? Basically this is an always-on device that cannot provide most always-on services. So this is my quest to make the device useful.
Yes naturally I realize that there are downsides to both devices, and I gladly give credit to the IPhone UI, but personally I'd rather deal with a command-line UI if I had to choose between functionality and having a fancy but incapable toy.
Jailbreaking
Basically everything you would need to do to change the Iphone's default behavior involves Jailbreaking the device. There are numerous tutorials available, but for my 2.2.1 IPhone it boils down to:
- Install ITunes (Windows)
- Get QuickPwn
- Get 2.2.1 Firmware (same page)
- Run it, tell it where you downloaded the firmware to, do what it tells you, you're done
Now that it's out of jail, you should have Cydia and Installer. The former is an APT-based package manager, for those familiar with Ubuntu and Debian in general. It is backed by a pretty lofty repo of iphone apps, and the first thing you'll want to do is run Cydia and upgrade... Cydia. Until you do it will probably act funny. (It should prompt you if there is an update for it).
And that brings us to installing apps.
Additional Apps
The following apps are highly useful in messing around with all this (And are installable through Cydia, use the search tab):
- MobileTerminal (not strictly necessary if you can SSH into your IPhone from your PC)
- openssh (this is client and server)
- ericasadun (Erica's Utils - various command-line tools for messing with iphone innards)
- backgrounder (Allows applications to be backgrounded - that's what we actually want here)
- insomnia (Icon driven hack that keeps the iphone from sleeping. Sleeping is bad - it kills running apps)
Putting it Together
- Once you have backgrounder installed you can test it out by running your IM client of choice (I did this with IM+), holding home down until it says "bla bla backgrounded". Now if you return to IM+, it will still be logged in. That's victory number one
- The IM app will still die if the device goes to sleep, or is locked, and especially if you use password lock. (I had to disable password lock, not sure if there is a way around that)
- Run insomnia, and its icon will show "ON". Now you should be able to hit the power button, and IM should still work. (Some Insomnia Docs)
- There are other tweaks you can try if you're having trouble: Winterboard has "Extended Preferences" which unlocks a pref in Settings that allows you to dim screen but not lock. It's a desperate hack because the screen doesn't dim all that much
- Unfortunately, none of this helps you when IM+ (or another client) decides to lose connection, and then just sits there with the error message
- Unfortunately insomnia seems to somehow get turned off too
Configuring Backgrounder to leave IM+ always on:
Backgrounder is great, but every time your IPhone kills the IM client for any reason, you have to remember to background it again. Let's change that:
- Make sure you installed Erica's s Utils (Cydia, search for 'ericasadun'). That gives you the plutil utility
- SSH into your phone (You'll want to be on Wi-Fi for that). (or if you are patient, you can do this in mobile terminal. You did install mobileterminal from Cydia, right?). SSH Log in is root:alpine (openssh iphone docs)
- cd /var/mobile/Library/Preferences
- Backup your prefs file: cp jp.ashikase.backgrounder.plist jp.ashikase.backgrounder.plist.bak
- Convert it to xml: plutil -c xml1 jp.ashikase.backgrounder.plist
- Edit with nano and make it look like this: (Reference Docs are here)
- The above is for IM+. To determine the name for another app you want to always background, use sb -l - it's in there somewhere ...
- Save (ctrl-x)... If you are in mobile terminal, to type CTRL-anything you'll have to click
.?123, then #+=, then rightmost dot, then ABC, and finally the letter you want.
Yes... Fun. Some help on using Mobile Terminal - Convert it back to binary: plutil -c binary1 jp.ashikase.backgrounder.plist
- You probably need to reboot at this point for it to take effect
Conclusion
Until there is real IM push, this is going to remain a big ugly hack with questionable stability. Good luck.
hi,
excellent info. exactly the post i was looking for. i thought backgrounder was enough to keep the apps running.
The insomnia app was the one i didnt know about. 99% of the people are having this trouble but none have the solution. all the forums are filled with IM's logging out even if backgrounder is running and most are thinking its some trouble with the IM client.
thanks a ton for this trick.