I am building a Gmail notifier which needs the ability to notify for new emails in realtime. Is it possible to do this with Gmail APIs? FYI, authentication is implemented using Gmail’s xoauth2 protocol.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Gmail’s IMAP servers support the IDLE command which is the best way to implemnt email notifications because it results in very low traffic and immediate push notifications of new emails. IDLE is documented at:
https://www.rfc-editor.org/rfc/rfc2177
note the part that you’ll need to end the IDLE session and restart it every 29 minutes (possible Google has set it lower also, you should experiment) in order to prevent the Gmail IMAP server from terminating the connection.
All of this should work without issue when doing OAUTH 2.0 authentication.