【发布时间】:2017-06-19 02:33:27
【问题描述】:
我正在使用以下代码向 gmail 发送监视请求。但它会为邮箱上的每个操作发送推送通知。如果只收到新电子邮件,我需要谷歌发送通知。否则我不希望谷歌发送通知。我正在使用 google-api nodejs 客户端。谁能帮我解决这个问题?
watch (cb) {
const params = {
userId: 'me',
resource: {
labelIds: ['INBOX'],
labelFilterAction: 'include',
topicName: configure.Google.TopicName
}
};
this.gmail.users.watch(params, cb);
}
【问题讨论】:
-
应该可以。你确定你得到了每一个动作吗?也许您只需要排除
CATEGORY_PERSONAL、CATEGORY_SOCIAL等即可。
标签: gmail-api google-api-nodejs-client