我如何使用Google People API在Android中获取其他联系人?

huangapple go评论38阅读模式
英文:

How can i get other contacts in android by using google people api

问题

我按照这里的文档进行了操作。他们已经提供了otherContacts()函数,但在PeopleService类中找不到该函数。

ListOtherContactsResponse response = peopleService.otherContacts().list()
.setReadMask("metadata,names,emailAddresses")
.execute();

List<Person> otherContacts = response.getOtherContacts();

尝试使用此代码,但未找到ListOtherContactsResponse类和otherContacts()函数在PeopleService中。我正在使用以下依赖项:

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'
英文:

I followed through the documention of people api <https://developers.google.com/people/v1/other-contacts>.They already provided the function otherContacts() but it is not available in PeopleService class

ListOtherContactsResponse response = peopleService.otherContacts().list()
.setReadMask(&quot;metadata,names,emailAddresses&quot;)
.execute();

List&lt;Person&gt; otherContacts = response.getOtherContacts();

tried with this code but didn't find ListOtherContactsResponse class and otherContacts() in PeopleService. I am using these dependencies

compile &#39;com.google.api-client:google-api-client-android:1.23.0&#39;
compile &#39;com.google.oauth-client:google-oauth-client-jetty:1.23.0&#39;
compile &#39;com.google.apis:google-api-services-people:v1-rev277-1.23.0&#39;

答案1

得分: 1

Finally this version solves my problem.

英文:

com.google.apis:google-api-services-people:v1-rev20200720-1.30.10
Finally this version solves my problem

huangapple
  • 本文由 发表于 2020年7月23日 00:53:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/63039374.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定