- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
在尝试使用用户的 google 帐户获取联系人时,我在使用 people API 后遇到了一些问题。它只返回所有列出的电子邮件地址中的几个。访问 token 和所有范围都已正确设置。以下代码:
People peopleService = new People.Builder(httpTransport, jsonFactory, credential)
.build();
ListConnectionsResponse response = peopleService.people().connections().list("people/me")
.setPageSize(500).setSortOrder("FIRST_NAME_ASCENDING")
.setAccessToken(tokenResponse.getAccessToken())
.setAlt("json")
.setRequestMaskIncludeField("person.names,person.emailAddresses,person.phoneNumbers")
. execute();
connections = response.getConnections();
如果我使用 google 的联系 API 而不是这个,那么我得到的电子邮件地址比人多。联系 API 的代码:
URL feedUrl = new URL("https://www.google.com/m8/feeds/contacts/default/full");
ContactFeed resultFeed = myService.getFeed(feedUrl, ContactFeed.class);
// Print the results
System.out.println(resultFeed.getTitle().getPlainText());
for (ContactEntry entry : resultFeed.getEntries()) {
....
.....
.......
}
我想知道它们之间是否有任何区别,我必须使用哪个以获得更好的结果,或者我是否遗漏了什么。请建议。谢谢..!!
最佳答案
People API 是最新的。通读Google's blog announcement , People API 简化了对 Google+ API 和 Contacts API 的单独调用。现在你只需要使用一个。
"The new People API uses the newest protocols and technologies and will eventually replace the Contacts API which uses the GData protocol"
获取用户的 list of connections 时, 请务必指定 correct scopes使用时。
https://www.googleapis.com/auth/contacts
- 请求为您的应用授予对经过身份验证的用户的 Google 通讯录中联系人的读写权限。https://www.googleapis.com/auth/contacts.readonly
- 请求您的应用获得对经过身份验证的用户的 Google 通讯录中联系人的读取权限。
检查这个link for similarities and differences People API 和 Contacts API 之间。
关于android - google 的 People API 与 contacts API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37695695/
我正在开发一个应用程序,我在其中显示来自服务器的一些联系人,目前我正在对来自服务器的联系人进行排序,但现在我想使用 IOS -> 设置 -> 联系人 -> 显示顺序读取联系人设置新的联系人框架,我没有
我希望检测一个(球)何时接触另一个物体(目标),并且我希望知道该接触的冲动。 我知道三种检测联系人的方法 gContactAddedCallback 或 int numManifolds =
我正在开发我的第一个 Android 应用程序,想知道我可以调用什么来显示这个“联系人 Pane ”: 当然,我指的是下方带有联系人照片、姓名和操作图标的小 Pane 。 作为一个相关问题...这个小
我正在研究如何从 android 上的联系人列表中导入数据。在模拟器中,我注意到一个位于顶部的联系人组,其中只包含一个我自己的联系人。其余联系人如下。 但是,当我使用下面的代码时 Intent pic
如何添加从地址簿/联系人列表导入联系人号码并将其添加到数组中的功能? 编辑 如果您看过高级通话管理器应用程序,它允许您从联系人列表中选择联系人并将其添加到黑名单。我想做同样的事情,从联系人列表中选择一
我正在阅读有关内容提供商的信息,并且对从 android 中选择联系人有点困惑。我从 Stackoverflow 中阅读了很多示例,并且混淆了一些人正在使用 content://contacts/pe
.NET 有许多不同的 Google API dll,例如 Google.Apis.Calendar.v3。但联系人 API 没有任何内容。使用旧版本或其他方法并不是解决方案,因为我已经使用了多个 A
我收到此错误 django.urls.exceptions.NoReverseMatch:未找到“联系人”的反向。 “contact”不是有效的 View 函数或模式名称。我可能做错了什么,djang
每当我使用 Google Contacts Api v3 列出我的联系人时,查询都会返回 480 个结果,而我在我的联系人上只有 269 个联系人列表。 我正在尝试过滤它们,以便它只显示来自我的联系人
我正在使用 django 1.3.1 和 satchmo 0.9.2。我使用了 Satchmo 附带的默认模型,称为“Contact”。我创建了一个 satchmo_mod 应用程序和一个 admin
当我使用“这个解决方案”时,我得到一个空白的联系人数组。 我在 examples/contacts 文件夹中使用“google-api-php-client-0.6.7”和 serviceAccoun
使用 ABAddressBook,当我希望用户能够为他们以前从未见过的联系人选择“创建新联系人”和“添加到现有联系人”选项时,我会创建并显示一个 ABUnknownPersonViewControll
我正在探索 ionic 4 中的新导航(类型为 angular),您可以在选项卡项目中找到它 href="/tabs/(contact:contact)" 什么是 (contact:contact)
我已经使用这个 API 6 年了,没有任何问题,但是从 3 天前开始,我遇到了一系列奇怪的行为,意识到我的 google 联系人开始不受控制地复制。我发现它与检索联系人时 1.500 的奇怪限制有关,
我在 main 中初始化了 box 数据库如下 void main() async { WidgetsFlutterBinding.ensureInitialized(); final
我使用 var contacts:[details] 编写代码? = nil 我遇到了无法访问 contacts?.count 的问题,我不得不在任何地方使用可选值。例如 contacts[index
我正在从我的手机联系人列表中获取我的联系人图像 uri。 但是,当我尝试将图像 uri 转换为位图时,我收到错误: java.io.FileNotFoundException: content://c
我浏览了很多帖子,但没有找到任何有效甚至正确回答问题的答案。我最接近的是这个 How to avoid duplicate contact name (data ) while loading con
我正在使用 Google Contact API v3。目标是在我的数据库和 Google 帐户之间同步联系人。我的问题是: 1) 当我在没有联系人组的情况下通过电子邮件地址搜索联系人时,我得到了一个
我想在联系表单 7 中的特定输入类型上添加 Id 和 Class 属性。 当我添加以下示例时,它在输入类型上方的 SPAN 标记上应用 Id 和 Class [radio amount id:amou
我是一名优秀的程序员,十分优秀!