Filed under: Internet Tools, iPhone
Push for Gmail: it's here, it works, and it's limited
If you use Gmail, you have something to be excited about today, because you can finally have new email messages pushed directly to your iPhone when they arrive.For many users, however, their first response is "it's about time!" and others have even gone as far as saying "it's finally here, no thanks to Apple." This new feature, unveiled this morning by Google, has even been called a "workaround" to Apple's alleged refusal to support push email, but in reality this isn't the case.
Push: What is it, and how does it work?
To understand why push services have not been available before, let's first discuss what exactly push is. When a client (be it a mail program, Twitter client, or web browser) needs to notify a user when new content or information is available, it has to periodically connect to the server and check for changes.
This is the way email clients have worked for years: the client checks with the server at a defined interval (usually every 5-15 minutes), downloads any new messages, and notifies the user that new mail has arrived. Many other services, such as RSS feeds, Twitter, Facebook, and even the Gmail website work the same way; they just check the server more often, which gives the appearance of real-time notifications.
Other services, such as instant messaging clients, maintain a constant, active connection to the server at all times. When new information is available for the client, the server sends, or "pushes" the information directly to the client as soon as it is available. In corporate environments, mail services such as Microsoft Exchange have paved the way for push email, by having the mail client (usually Outlook, Entourage, or other clients that support Exchange) maintain an active connection to the mail server, which allows the server to notify the client immediately when new mail arrives.
Read on to find out how Gmail push works, and what you need to know to get it set up on your phone.
OK, my iPhone supports push notifications, why can't it do push email?
In order for push notifications to work on your iPhone, a few things must happen. Your phone has to frequently maintain a connection to Apple's servers, so that it can receive notifications when needed. Then the application you are using must register with Apple's servers, letting them know that you wish to receive notifications on your phone for that application or service. Finally, whenever the service needs to notify you of an event, it has to connect to Apple's servers, and tell them "hey, I have a message for iPhone xyz. Apple, in turn, pushes the message to your phone if it is available.
As you can see, there are a few pieces at work here, and the process isn't perfect. In order for Apple to provide native push notifications for e-mail services, either the email service provider (in this case Gmail, but this would apply to any mail provider) would have to send Apple a notification with every single email message that was received, or Apple's servers would have to proactively connect to and check email inboxes for every mail account on every iPhone for which push was enabled. Now *that* is a lot of work. We already know Apple's services are not perfect -- MobileMe email frequently has delivery problems and delays, push notifications don't always go through, and the list goes on. Could you imagine their network handling the additional load of receiving millions of email notifications every minute, and/or maintaining connections to thousands of servers, constantly checking for new email, just to notify iPhone users that they just got a new email in their inbox? Yeah, I can't either.
But MobileMe and Yahoo both support push!
This is true. These services allow push because the mail servers used support push. MobileMe and Yahoo both support proprietary flavors of the "Push IMAP" protocol, so Apple included support for that feature in the iPhone's Mail application. However, Gmail has not actually supported push connections that worked with common mail clients until today. Yes, the Android OS has some support for it, but that is something that was built in by Google.
So how does Gmail's push service work? Is it a "workaround" or a "hack"?
Gmail has enabled push email by creating an interface on their servers that emulates a Microsoft Exchange server, called Google Sync. They actually have had this around for some time, allowing you to sync your contacts and calendars with your Google account, but email was not supported until now. This isn't a hack or a workaround, but a true push connection, because iPhone's Mail app will establish a connection directly with Google and listen for mail notifications, so it's not relying on all the pieces of the puzzle it would need to go through Apple's servers, which means it's better and more reliable than using other methods.
Wow, that's cool. So what's the catch?
There's always a catch, isn't there? This one is simple and straight forward, but I'm sure it's still going to ruffle a few feathers: you can only have one Exchange account on your iPhone at a time, which means if you're like me, and you have several Gmail-based (Google For Your Domain) accounts, you can only have one configured as an Exchange push account.
[As pointed out by our colleague Joachim Bean, regular push notifications are not delivered when your phone is on Wi-Fi alone unless your screen is on or you're plugged into power to conserve battery power. However, that's a different kind of 'push' from the similarly-named push email; we apologize for the confusion.]
How do I set it up?
You will have to remove your existing Gmail account, and set it up again as Exchange. Google has provided step-by-step instructions for setting things up. You can sync your mail, contacts and calendars, but beware that you might delete your existing contacts and calendars if you aren't careful, so be sure to back up your phone first, and read both the instructions and any messages you receive on the phone carefully before you pull the trigger.


![TUAW [Cafepress]](http://www.blogsmithmedia.com/www.tuaw.com/media/tuaw-cafepress-promo.png)


Reader Comments (Page 1 of 5)
BuiltByBen said 4:10PM on 9-22-2009
Now I just wish i could hide the [Google Mail] folder in the inbox. I've removed all the labels but it's jut sat there all grey out. It really bugs me
Reply
Sol Goode said 7:27PM on 9-22-2009
Activate [advanced imap controls] under the [labs] tab in your settings. it will let you show/hide folders on gmail for mail clients, among other things you might find useful.
KarlW said 7:52PM on 9-22-2009
@Sol Goode
That does not apply. We're not doing this over IMAP, but over Exchange. See here: http://www.google.com/support/forum/p/Google+Mobile/thread?tid=758a952d3518529f&hl=en
ragingrumor said 12:31AM on 9-23-2009
Which is funny, because the Palm Pre lets you have multiple Exchange accounts.
Sid said 3:59AM on 9-23-2009
this might be what you're looking for.
on your iphone, go to settings, mail, and head to the Advanced section. Set your IMAP path prefix to INBOX.
That should get rid of all the excess folders.
Dom said 6:25AM on 9-23-2009
I believe Google actually removed the need for [Gmail] or [Google Mail] IMAP prefixes at the same time as they switched on push email.
Try removing the prefix entirely, then going to GMail and renaming any labels that start [Gmail] or [Google Mail] to edit that part out. It's currently working perfectly for me with no prefix specified.
Modano said 4:12PM on 9-22-2009
So I can't use my work Exchange account and a GMail push account simultaneously on my phone? I wonder why they only support 1 push account per iPhone? That sucks.
Reply
Branden Russell said 4:21PM on 9-22-2009
No, they support one Exchange account. You can have a MobileMe, Yahoo, and an Exchange account all doing push at the same time.
Just Cause said 4:27PM on 9-22-2009
Yeah, I think this sucks also!!!!! I wish Google had licensed Apple push technology instead. I'm sure if Apple wanted to add more Exchange capable accounts to the iPhone or Mail they'd need to pay M$ again.....
Rob said 7:07PM on 9-22-2009
It's more than money for M$, one of the biggest complaints Apple gets (besides AT&T) is battery life on the phone, and more than one exchange account on the phone at a time would hurt that even more. Apple has a tough balancing act to play with over-doing functionality and balancing with battery life.
Brian said 7:22PM on 9-22-2009
I believe this is a Microsoft limitation. Even on their WinMo phone I don't believe you can be connected to more than 1 Exchange Server.
fellowweb said 12:53PM on 9-23-2009
@Rob:
No, this is wrong: It's not Apple to decide for me how I would like to cope with the functionality/battery trade-off. This should be only up to me. If I wanted to trade in battery life for another Exchange connection, I should be able to do so - especially when looking at the iPhone's price tag.
However, this is something Apple gets more and more wrong especially with its understanding of the iPhone as a closed platform:
Customer wants applications? - Fine but only through the Apple App Store and having undergone some fine censorship.
Customer wants multitasking? - Oh, gosh, no. Customers may not understand that this eats battery life and the iPhone's GUI speed may drop. Let's try to imitate this with this weird push notifications set up which requires additional Apple servers as a 3rd party which could be hit by an outage.
I am close to making back the switch to Windows. It may not be the better OS - but it's definitely far more open.
cmherbert said 4:16PM on 9-22-2009
I would like to add that once you set up PUSH, go back to the account settings and select the "Mail Folders to Push" setting. You can set up PUSH for any of your Gmail folders.
Reply
strang said 4:16PM on 9-22-2009
Beware like all new things the service is really slow. Google servers are being hammered.
I had previous setup Calendar and Contacts with Google Sync and was enjoying this for a while now. All it was needed was to disable the IMAP Gmail account and enable E-mail under the Sync account. But it's unreliable and slow as of now.
It will get better, if your emails are mission critical then stick to IMAP for a few more days before lighting up Exchange!
Reply
KarlW said 7:51PM on 9-22-2009
Well, if I had to bet on one company to come up with the server capacity to do this, it's Google.
strang said 10:34AM on 9-23-2009
I tried it again today and the service is much faster now. Still errors here and there as I browse through my mail folders but push works pretty much instantaneously.
Justin said 4:18PM on 9-22-2009
I just get a dialog that says "Cannot Get Mail The connection to the server failed."
Reply
cmherbert said 4:18PM on 9-22-2009
More about not being able to hide folders: http://www.google.com/support/forum/p/Google+Mobile/thread?tid=758a952d3518529f&hl=en
Reply
ItGuy said 4:55PM on 9-22-2009
Exchange is not the only one that has this.
IMAP supports it via IDLE
Lotus Notes supports it
Blackberries have supported it forever.
Exchange is probably the worst example as it's a POS on all accounts.
Reply
rush0 said 10:37AM on 9-23-2009
Why is Exchange a POS on all accounts?