1
我正在使用下面的代码向gmail发送手表请求。但它正在为邮箱上的每个操作发送推送通知。如果只收到新电子邮件,我需要谷歌发送通知。否则,我不希望谷歌发送通知。我正在使用google-api nodejs客户端。任何人都可以帮助我吗?gmail api上的手表请求问题
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'等。 – Tholle