小编Jor*_*dan的帖子

Gmail API Watch不按标签过滤

我正在使用Google推送通知与Google PubSub,并有一个自定义标签,我想监视任何更改.我使用以下代码为标签注册手表(标签的标识为Label_1)

WatchRequest wr = new WatchRequest();
wr.TopicName = "projects/" + primaryLink.ggProjectId + "/topics/iLink" + segmentId;
if (labels != null && labels.Count > 0)
{
    wr.LabelIds = new List<string>();
    wr.LabelIds.Add("Label_1");
    wr.LabelFilterAction = "include";
}

WatchResponse wrr = gs.Users.Watch(wr, emailAccount).Execute();
return "HistoryId " + wrr.HistoryId.ToString();
Run Code Online (Sandbox Code Playgroud)

}

手表注册正常.问题是我收到任何Gmail更改的推送通知,而不仅仅是标签下的更改.

是否支持自定义标签?

gmail-api

11
推荐指数
1
解决办法
1579
查看次数

标签 统计

gmail-api ×1