gmail-api 检查有多少邮件未读且用户未回复

gmail-api to check how many mails are unread and user has not replied to

我正在开发一个基于 gmail-api 的 android 应用程序,我需要在其中显示有多少邮件未读(基于特定的 sender/subject),并且还需要显示用户未回复的邮件数量(基于特定 sender/subject)。如果有人这样做过,请告诉我这是否可行。

您需要使用 Users.messages: list 方法,因为它只有 return 条消息匹配指定的查询。它支持与 Gmail 搜索框相同的查询格式。例如,from:someuser@example.com rfc822msgid: is:unread.

同样基于这个相关的SO ticketq参数(查询)可以是各种各样的东西,它与网页界面顶部的gmail搜索栏相同。您可以使用此搜索方法查找未读消息,例如 List<Message> unreadMessageIDs = ListMessages(service, "me", "is:unread");.

希望对您有所帮助! :)