简体   繁体   中英

How to get user's location in iOS using google plus sdk?

I am integrating Google Plus login in my app along with Facebook and Twitter login. So, is it possible to get user's location(city) Like Facebook and Twitter? If yes, how?

Any kind of help would be appreciated.

There is a field in the Google+ profile for "places lived" that may contain a location. However, it is not very common for people to share that publicly, so you will likely find only a small proportion of users have it available.

If you want to try, you can retrieve the profile data by following this documentation: https://developers.google.com/+/mobile/ios/people#retrieve_profile_information - this returns GTLPlusPerson for the current user.

From that, look at the placesLived property: https://code.google.com/p/google-api-objectivec-client/source/browse/trunk/Source/Services/Plus/Generated/GTLPlusPerson.h?r=246#128

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM