Google+ API: get currentLocation profile

I am currently creating a test and trying to find the location of a Google+ user. I test myself and set my position publicly.

I originally planned to use Google Latitude, however, since Google has deprecated this API several times, my only option is to use the Google+ API.

The currentLocation parameter was added a few months ago

So I'm trying to get this. But this failed.

I tested 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 the one.

Then I tested in google + explorer, but the same thing, nothing worked

Has anyone already encountered a similar problem?

I have some ideas where it might come from:

  • Does Oauth2.0 provide access to this information (I have tried any possible amount of data)
  • Is there a bug in this function?
  • Is this restricted to verified users?
  • Or maybe it's just not possible?

Thank!

+45
geolocation google-plus
Jul 31 '13 at 15:22
source share
3 answers

Access to location data is limited to users who provide you access to their location data during the creation of the OAuth token.

You need to request access to location data in the area parameter.

+1
Jan 09 '14 at 0:00
source share

This is an old but relevant issue. Even the field "currentLocation" is displayed as a valid answer "Field of objects of people" , it is impossible to get data about the field.

Reported as a problem in the G + repository , but no answer yet.

If you are still trying to get the current location of the user, try the following snippet, not sure if this is the best option, but it works :):

Note: "r" contains client.request () response data (API call)

r.placesLived.forEach(function(l) { if (l.primary) console.log(l.value); }); 

Hope this helps. Greetings.

0
Oct 16 '14 at 0:20
source share

I think r.placesLived will only indicate its location, but the user's location or the location of the exact machine. One might remember that you need to have an address. However, to check the exact location of the user, he needs to look for another token. This may require more tracker, not just space.

0
Jan 26 '15 at 8:09
source share



All Articles