iOS Facebook SDK - getting user location -


By using

FBLoginView , I can log in users and use a FBGraphUser < / Code> object that holds data in the following structure:

FBGraphUser
| --- Username
| --- email
| --- ID & LT; FBGraphPlace & gt; Location
| --- place_name
| --- ID & lt; FBGraphLocation & gt; Location
| --- city
| --- street
| --- Latitude / Longitude
View Facebook for a better picture :)

I have the correct place_name with the user's FBGraphPlace location < / Code> but the FBGraph location is empty.

I need access to this data, and this is where I've been stumped. I have ensured that the information of the user's location is publicly visible, and I sent the readPermissions of FBLoginView to @ "user_location" Is set to include. Do anyone know where I can make my mistake? Thanks!

Editing - Solution: My Facebook address field was empty I forgot for the 'current city' address.

Try to do this: id & lt; FBGraphUser & gt; FbUser = (id & lt; FBGraphUser & gt;) user; In the & lt; FBGraphPlace & gt; FB Place = [FBUser Location]; In the & lt; FBGraphLocation & gt; FbLocation = [Fb Place Place]; NSString * userCity = [FBOllocation City]; NSString * userCountry = [FB location country]; NSString * userZip = [FBonation zip];

You are currently accessing the property named FBGraphPlace which is giving you an NSString of the location. You want to use the property instead of the location, which is an FBG parachute . This object contains the properties of different components that you want.

But I'm not sure this is what you need.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -