Google+ API:获取个人资料的当前位置 [英] Google+ API : Get Profile's currentLocation

查看:122
本文介绍了Google+ API:获取个人资料的当前位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在构建测试并尝试获取Google +用户的位置信息。我正在测试自己,并已将自己的位置公开。



我原本打算使用谷歌纵横,因为谷歌在几天内弃用这个API ,我唯一的选择就是使用Google+ API。



参数 currentLocation是在几个月前添加的



因此,我试图获得它。但无法做到这一点。

我在自己的服务器上使用PHP API进行了测试,然后使用了Oauth2.0的JS API,但是这个该死的参数永远不会被发回。我可以得到任何其他参数,但绝对不是那个。

然后,我已经在google + explorer中进行了测试,但是同样的东西在这里,什么都没有出来



有没有人遇到过类似的问题?

我有一些想法,它可能来自哪里:


  1. Oauth2.0是否允许我访问这些信息(我已经试过
    任何可能的数据范围)

  2. 是否仅仅是这个功能的一个bug?

  3. 是否仅限于验证用户?

  4. 或者它可能不可行?

谢谢!

解决方案

仅限于授予您在生成OAuth令牌时访问其位置数据的用户。

您必须特别要求访问范围参数。


I'm currently building a test and trying to get a google+ user location. I'm testing on myself and have set my position to public.

I was originally planning to use Google Latitude, however, since Google is deprecating this API in a few days, my only option is to use the Google+ API.

The parameter currentLocation was added a few months ago

I'm therefore trying to get it. But could not manage to do it.

I've tested on my own server using the PHP API and then the JS API with Oauth2.0, but this damn parameter is never sent back. I can get any other parameter but definitely not that one.

Then I've tested in the google+ explorer, but same thing here, nothing came out

Does anyone have already encounter a similar issue ?

I have a few idea where it could come from :

  1. Does Oauth2.0 does not let me access this information (I've tried any possible data-scope)
  2. Is there just a bug on this functionality ?
  3. Is it restricted to verified users ?
  4. Or maybe it's just not possible ?

Thanks !

解决方案

Access to location data is restricted to users who have granted you access to their location data at the time that the OAuth token was generated.

You have to specifically request access to location data in the scope parameter.

这篇关于Google+ API:获取个人资料的当前位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆