【发布时间】:2020-07-22 16:53:56
【问题描述】:
我查看了 people api 的文档 https://developers.google.com/people/v1/other-contacts。他们已经提供了函数 otherContacts() 但在 PeopleService 类中不可用
ListOtherContactsResponse response = peopleService.otherContacts().list()
.setReadMask("metadata,names,emailAddresses")
.execute();
List<Person> otherContacts = response.getOtherContacts();
尝试使用此代码,但未在 PeopleService 中找到 ListOtherContactsResponse 类和 otherContacts()。我正在使用这些依赖项
compile 'com.google.api-client:google-api-client-android:1.23.0'
compile 'com.google.oauth-client:google-oauth-client-jetty:1.23.0'
compile 'com.google.apis:google-api-services-people:v1-rev277-1.23.0'
【问题讨论】:
-
嗨,欢迎来到 StackOverflow!如果您有任何相关代码可以帮助其他人更好地帮助您,请将其也包含在您的问题中。请参阅How to ask 了解更多信息。
-
嗨!您是否收到任何控制台错误,如果有,是哪个错误? 注意: 这是reference of otherContacts.list(),您还可以在其中测试请求并查看它是否可以轻松工作。试试 API,如果它也失败了,请告诉我。谢谢 ! :D
-
@MateoRandwolf 我正在使用 android studio,android studio 本身说 PeopleService 中没有功能(otherContacts())。我使用的是不同的旧版本的人员服务依赖项吗?
标签: java android google-people-api