Advice for APNS push server for new email notifications
How would you implement an APNS server that checks for new email and sends a push notification to an iPhone when one is detected? I am wondering more at an architectural level. For the sake of simplicity, let's say we're building a push server for gmail. The challenges that I can see are:
How do you continuously poll Gmail for potentially tens of thousands of unique email accounts for new mail? Would gmail even allow this from a single set of IPs?
Gmail has an IMAP and Inbox feed. In order to detect if a new piece of mail has arrived, would you need to remember the last email that was received (or pushed) for each account?
Would the CPU cycles and bandwidth required for this continuous polling make a cloud solution such as EC2 or RackSpace affordable?
How do you handle authentication and authorization in a secure fashion? For example, I once used a gTalk client on my iPhone which had push notifications and Gmail warned me the next time that I logged in from the web interface that my account was accessed from an unusual IP. Is there a way to avoid this? Would you store the user's credentials on the server? An OAuth token?
I should mention that this is to please my personal curiosity but it might als开发者_开发技巧o be an interesting project for learning to program in Erlang.
Any insight on this would be greatly appreciated.
You might want to check this:
http://code.google.com/apis/gmail/
精彩评论