Discussion:
PHP Google APIs Client: How to get user's location
Adam Tong
2014-09-14 21:53:16 UTC
Permalink
Hi,

I implemented successfully a sign-in with google feature in my website. Now
I want to retrieve the user's location after he signs in. How can I do that?

At this moment here is the scope that i have: $client->setScopes('email');`
I guess I have to change that.

And to retrieve data I have the following:
$client->verifyIdToken()->getAttributes(); Do I need another method than
this?
thanks
Jeffry Killen
2014-09-15 01:15:24 UTC
Permalink
Post by Adam Tong
Hi,
I implemented successfully a sign-in with google feature in my
website. Now
I want to retrieve the user's location after he signs in. How can I do that?
At this moment here is the scope that i have: $client-
Post by Adam Tong
setScopes('email');`
I guess I have to change that.
$client->verifyIdToken()->getAttributes(); Do I need another method than
this?
thanks
Have you tried this?
$_SERVER['HTTP_referer'] // page that the user is coming from if
another web site page link
$_SERVER['SRC_ADDRESS'] // clients source ip address, but this is
probably a ISP's assigned address
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jim Lucas
2014-09-15 15:47:46 UTC
Permalink
Post by Adam Tong
Hi,
I implemented successfully a sign-in with google feature in my website. Now
I want to retrieve the user's location after he signs in. How can I do that?
At this moment here is the scope that i have: $client->setScopes('email');`
I guess I have to change that.
$client->verifyIdToken()->getAttributes(); Do I need another method than
this?
thanks
This is not a PHP issue. Why not ask the makers of the API?

https://github.com/google/google-api-php-client
--
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Loading...