Ios 如何使用gmail api检测已读未读邮件?

Ios 如何使用gmail api检测已读未读邮件?,ios,objective-c,gmail,gmail-api,Ios,Objective C,Gmail,Gmail Api,我正在开发一个邮箱应用程序,作为gmail邮件的“GTLGmailMessage”对象,我得到以下响应:- 我查阅了api文档,但找不到任何解决方案 有没有办法检测邮件是否已读 { historyId = 80237; id = 152589a56bea2515; internalDate = 1453185455000; labelIds = ( INBOX, IMPORTANT, "CATEGORY_UPDATES" ); payload = {

我正在开发一个邮箱应用程序,作为gmail邮件的“GTLGmailMessage”对象,我得到以下响应:- 我查阅了api文档,但找不到任何解决方案

有没有办法检测邮件是否已读

{
historyId = 80237;
id = 152589a56bea2515;
internalDate = 1453185455000;
labelIds =     (
    INBOX,
    IMPORTANT,
    "CATEGORY_UPDATES"
);
payload =     {
    body =         {
        data = DQp———— — dG9bmtzIQ0K;
        size = 732;
    };
    filename = "";
    headers =         (
                    {
            name = "Delivered-To";
            value = "hussain@walkover.in";
        },
                    {
            name = Received;
            value = "by 10.37.100.68 with SMTP id y65csp2443890ybb;        Mon, 18 Jan 2016 22:37:35 -0800 (PST)";
        },
                    {
            name = "X-Received";
            value = "by 10.13.239.129 with SMTP id y123mr16831747ywe.167.1453185455680;        Mon, 18 Jan 2016 22:37:35 -0800 (PST)";
        },
                    {
            name = "Return-Path";
            value = "<noreply@github.com>";
        },
                    {
            name = Received;
            value = "from github-smtp2b-ext-cp1-prd.iad.github.net (github-smtp2-ext3.iad.github.net. [192.30.252.194])        by mx.google.com with ESMTPS id q63si16585388ywb.331.2016.01.18.22.37.35        for <hussain@walkover.in>        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);        Mon, 18 Jan 2016 22:37:35 -0800 (PST)";
        },
                    {
            name = "Received-SPF";
            value = "pass (google.com: domain of noreply@github.com designates 192.30.252.194 as permitted sender) client-ip=192.30.252.194;";
        },
                    {
            name = "Authentication-Results";
            value = "mx.google.com;       spf=pass (google.com: domain of noreply@github.com designates 192.30.252.194 as permitted sender) smtp.mailfrom=noreply@github.com;       dkim=pass (test mode) header.i=@github.com;       dmarc=pass (p=NONE dis=NONE) header.from=github.com";
        },
                    {
            name = Date;
            value = "Mon, 18 Jan 2016 22:37:35 -0800";
        },
                    {
            name = "DKIM-Signature";
            value = "v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1453185455; bh=PQFrfD7nxfJCQgsdom7s6/TMtuIlEPwr4GKz/BVEYNE=; h=From:To:Subject:From; b=PbKfqrQfPtJzh2YsK2RqLPahAYL8Wk40aW1GnqZqNCZp0dehGTRCByYDg4HT93m89\t NK+BbCDbcSgkiII6NnBildbsorKfenoVE2jTS21fllusq1Oflmyayo1GyRvGOkFEd1\t WCgQlsicXhXniFDza60ibwwcABXyB/yVCcnrrpGk=";
        },
                    {
            name = From;
            value = "GitHub <noreply@github.com>";
        },
                    {
            name = To;
            value = "hussain@walkover.in";
        },
                    {
            name = "Message-ID";
            value = "<569dd9af5be8b_5b613f8adf71f29c19092@github-lowworker7-cp1-prd.iad.github.net.mail>";
        },
                    {
            name = Subject;
            value = "[GitHub] Subscribed to SendOTP/iOS notifications";
        },
                    {
            name = "Mime-Version";
            value = "1.0";
        },
                    {
            name = "Content-Type";
            value = "text/plain; charset=UTF-8";
        },
                    {
            name = "Content-Transfer-Encoding";
            value = "quoted-printable";
        },
                    {
            name = "X-Auto-Response-Suppress";
            value = All;
        }
    );
    mimeType = "text/plain";
    partId = "";
};
sizeEstimate = 2601;
snippet = "Hey there, we&#39;re just writing to let you know that you&#39;ve been automatically subscribed to a";
threadId = 152589a56bea2515;
{
historyId=80237;
id=152589a56bea2515;
internalDate=1453185455000;
labelIds=(
收件箱
重要的,,
“类别更新”
);
有效载荷={
正文={
数据=DQp----dG9bmtzIQ0K;
尺寸=732;
};
filename=“”;
标题=(
{
name=“交付至”;
值=”hussain@walkover.in";
},
{
姓名=已收到;
value=“by 10.37.100.68,SMTP id为y65csp2443890ybb;Mon,2016年1月18日22:37:35-0800(太平洋标准时间)”;
},
{
name=“X-Received”;
value=“by 10.13.239.129,SMTP id为y123mr16831747ywe.167.1453185455680;周一,2016年1月18日22:37:35-0800(太平洋标准时间)”;
},
{
name=“返回路径”;
value=“”;
},
{
姓名=已收到;
value=“来自github-smtp2b-ext-cp1-prd.iad.github.net(github-smtp2-ext3.iad.github.net。[192.30.252.194]),由mx.google.com提供,ESMTPS id为q63si16585388ywb.331.2016.01.18.22.37.35(版本=TLS1_2密码=ECDHE-RSA-AES128-GCM-SHA256位=128/128);2016年1月18日星期一22:37:35-0800(太平洋标准时间)”;
},
{
name=“收到的SPF”;
value=“pass(google.com:domain ofnoreply@github.com指定192.30.252.194为允许的发送方)客户端ip=192.30.252.194;“;
},
{
name=“验证结果”;
value=“mx.google.com;spf=pass(google.com:domain of ofnoreply@github.com将192.30.252.194指定为允许的发件人)smtp.mailfrom=noreply@github.com;dkim=pass(测试模式)header.i=@github.com;dmarc=pass(p=NONE dis=NONE)header.from=github.com”;
},
{
姓名=日期;
value=“2016年1月18日星期一22:37:35-0800”;
},
{
name=“DKIM签名”;
value=“v=1;a=rsa-sha256;c=relaxed/relaxed;d=github.com;s=pf2014;t=1453185455;bh=PQFrfD7nxfJCQgsdom7s6/TMtuIlEPwr4GKz/BVEYNE=;h=From:To:Subject:From;b=PBKfqRQFPTJZH2YSK2RQLPhaYL8WK40AW1GNZQNCZP00DEHRCYDG4HT93M89\t NK+BBCDBCSGKII6NNNFORK2JT2KF11FLL1FLL1FLLYOFZZZYRKKKKKZZYB0KWWWWW0KBYBYBYBYBYBYBYBYBYBYBYBYBYBYBYBYBYBYBYB;
},
{
name=来自;
value=“GitHub”;
},
{
name=To;
值=”hussain@walkover.in";
},
{
name=“消息ID”;
value=“”;
},
{
姓名=受试者;
value=“[GitHub]订阅了SendOTP/iOS通知”;
},
{
name=“Mime版本”;
value=“1.0”;
},
{
name=“内容类型”;
value=“text/plain;charset=UTF-8”;
},
{
name=“内容传输编码”;
value=“可打印报价”;
},
{
name=“X-Auto-Response-Suppress”;
价值=全部;
}
);
mimeType=“text/plain”;
partId=“”;
};
sizeEstimate=2601;
snippet=“嘿,我们';写信只是想让您知道您';已经自动订阅了一个”;
threadId=152589a56bea2515;
}

如何检测邮件是否已读或未读

{
historyId = 80237;
id = 152589a56bea2515;
internalDate = 1453185455000;
labelIds =     (
    INBOX,
    IMPORTANT,
    "CATEGORY_UPDATES"
);
payload =     {
    body =         {
        data = DQp———— — dG9bmtzIQ0K;
        size = 732;
    };
    filename = "";
    headers =         (
                    {
            name = "Delivered-To";
            value = "hussain@walkover.in";
        },
                    {
            name = Received;
            value = "by 10.37.100.68 with SMTP id y65csp2443890ybb;        Mon, 18 Jan 2016 22:37:35 -0800 (PST)";
        },
                    {
            name = "X-Received";
            value = "by 10.13.239.129 with SMTP id y123mr16831747ywe.167.1453185455680;        Mon, 18 Jan 2016 22:37:35 -0800 (PST)";
        },
                    {
            name = "Return-Path";
            value = "<noreply@github.com>";
        },
                    {
            name = Received;
            value = "from github-smtp2b-ext-cp1-prd.iad.github.net (github-smtp2-ext3.iad.github.net. [192.30.252.194])        by mx.google.com with ESMTPS id q63si16585388ywb.331.2016.01.18.22.37.35        for <hussain@walkover.in>        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);        Mon, 18 Jan 2016 22:37:35 -0800 (PST)";
        },
                    {
            name = "Received-SPF";
            value = "pass (google.com: domain of noreply@github.com designates 192.30.252.194 as permitted sender) client-ip=192.30.252.194;";
        },
                    {
            name = "Authentication-Results";
            value = "mx.google.com;       spf=pass (google.com: domain of noreply@github.com designates 192.30.252.194 as permitted sender) smtp.mailfrom=noreply@github.com;       dkim=pass (test mode) header.i=@github.com;       dmarc=pass (p=NONE dis=NONE) header.from=github.com";
        },
                    {
            name = Date;
            value = "Mon, 18 Jan 2016 22:37:35 -0800";
        },
                    {
            name = "DKIM-Signature";
            value = "v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1453185455; bh=PQFrfD7nxfJCQgsdom7s6/TMtuIlEPwr4GKz/BVEYNE=; h=From:To:Subject:From; b=PbKfqrQfPtJzh2YsK2RqLPahAYL8Wk40aW1GnqZqNCZp0dehGTRCByYDg4HT93m89\t NK+BbCDbcSgkiII6NnBildbsorKfenoVE2jTS21fllusq1Oflmyayo1GyRvGOkFEd1\t WCgQlsicXhXniFDza60ibwwcABXyB/yVCcnrrpGk=";
        },
                    {
            name = From;
            value = "GitHub <noreply@github.com>";
        },
                    {
            name = To;
            value = "hussain@walkover.in";
        },
                    {
            name = "Message-ID";
            value = "<569dd9af5be8b_5b613f8adf71f29c19092@github-lowworker7-cp1-prd.iad.github.net.mail>";
        },
                    {
            name = Subject;
            value = "[GitHub] Subscribed to SendOTP/iOS notifications";
        },
                    {
            name = "Mime-Version";
            value = "1.0";
        },
                    {
            name = "Content-Type";
            value = "text/plain; charset=UTF-8";
        },
                    {
            name = "Content-Transfer-Encoding";
            value = "quoted-printable";
        },
                    {
            name = "X-Auto-Response-Suppress";
            value = All;
        }
    );
    mimeType = "text/plain";
    partId = "";
};
sizeEstimate = 2601;
snippet = "Hey there, we&#39;re just writing to let you know that you&#39;ve been automatically subscribed to a";
threadId = 152589a56bea2515;

提前感谢。

您可以在响应中的
标签ID
-数组中检查
未读标签

请求

GET https://www.googleapis.com/gmail/v1/users/me/messages/152d4596db9906f8
响应

{
 "id": "152d4596db9906f8",
 "threadId": "152d4596db9906f8",
 "labelIds": [
  "SENT",
  "INBOX",
  "IMPORTANT",
  "UNREAD"
 ],
 "snippet": "Cool message, buddy.", ...
}

邮件的已读/未读状态由未读标签的存在表示

您可以在下面的链接中找到管理标签检查的信息