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.
You couldn't just set up your favorite mail client and get instant notifications when mail arrived. Google's servers do support an IMAP feature which allows the mail client to send an IDLE command to the server, indicating that the connection is idle but that the client can receive notifications about new messages, which provides an experience that is effectively identical to push email. However, due to the different ways that this feature has been implemented in different mail clients, some users have had inconsistent results in having it work as expected.
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.