获取用户的家庭,工作和担任主角的位置,如谷歌的收件箱不收件箱、主角、位置、家庭

2023-09-05 05:27:50 作者:假洒脱

当在谷歌的收件箱,你去小憩的信息,然后选择选择地点它显示了你的家庭和工作地址(从谷歌现在)填充,以及从谷歌地图轮廓出演位置的列表。其他谷歌应用程序,如保持也提供类似的功能。

When in Google Inbox you go to snooze a message and select 'Pick place' it shows a list with your home and work address (from Google Now) populated as well as starred locations from your Google Maps profile. Other Google apps, like Keep also provide similar functionality.

我想在我的应用程序来实现这一点,但无法找到合适的API,公开这些信息。是的东西,谷歌不会暴露在第三方(我猜有空间滥用存在)?

I would like to implement this in my app but couldn't find the right API that exposes that information. Is that something that Google doesn't expose to 3rd parties (I guess there's room for abuse there)?

如果没有,这可怎么实现的?什么API有数据?

If not, how can this be implemented? What API has the data?

推荐答案

谷歌现在使用(登录到您的谷歌帐户设置中启用谷歌+定位服务的任何和所有设备)上的位置数据的分析,以确定您的家庭和工作位置,除非你专门设置它们。

Google Now utilizes analytics on your location data (on any and all devices signed into Google + location services enabled in your Google Account settings) to determine your home and work locations, unless you specifically set them.

该数据的存储/检索未明确提及的任何地方,我发现在谷歌官方文档,但在谷歌的模式现在对于这些数据,请访问: 谷歌模式 - 人

The storage / retrieval of this data is not explicitly referenced anywhere that I have found in official Google documentation, but the schema in Google Now for this data is available here: Google Schema - Person

对于任何人的实体,一个本地位置 workLocation 属性存在使用该数​​据。

For any given person entity, a homeLocation and workLocation property exists with that data.

或者(或除),使用谷歌的加平台/谷歌认证平台,如果你有一个身份验证的用户,你可以调用API所描述的的这里(举例) 即可得到任何指定的字段为当前用户(包括currentLocation,组织(包括工作),地址,如果用户提供它们)。

Alternatively (or in addition to), using Google's Plus Platform / Google Identity Platform, if you have an authenticated user, you can make an API call as described here (with examples) to get any of the specified fields for the current user (including currentLocation, organizations (including work) with addresses, if the user provided them).

一个previous SO质疑使用OAuth和原谷歌地图的参考供稿网址提取数据存在,但接受的答案是有些不清楚,当我跟着链接,试图验证测试它,我收到404从所有这些错误:Access在我的位置特定的帐户,通过谷歌地图API 位置

A previous SO question that references using oAuth and raw Google Maps feed urls to pull the data exists, but the accepted answer is somewhat unclear and when I followed the links and attempted authenticated to test it out, I received 404 errors from all of them: Access locations in My Places of a particular account through Google Maps API

另外,如一个谷歌产品论坛发布的 这里 几年前,谷歌地图数据API的previous版本允许访问的我的位置,这是典型的正是你所需要的,但它是pcated德$ P $和在2013年拆除。

Also as in a Google Product Forums post here several years ago, a previous version of the Google Maps Data API allowed access to My Places, which is quintessentially exactly what you need, but it was deprecated and removed in 2013.

最后,这是我认为最好的方法,而且可能是什么谷歌使用(如果它不声明为谷歌现在),这也是谷歌联系人API。用户存在于自己的联系人列表,并为谷歌联系广泛的API,可以让你得到/组地址与如家中或工作,为用户标准的标签。

Finally, and this is the best approach in my opinion, and may be what Google uses (if it isn't declared to be Google Now), which is the Google Contacts API. A user exists in their own contact list, and the extensive API for Google Contacts allows you to get/set addresses with standard labels such as home or work for the user.

这是一切都在这里详细介绍:谷歌联系服务 - 应用程序脚本

This is all detailed here: Google Contact Services - App Scripts