Facebook autocompletion city key is not the city id? - facebook

I am developing an app that will use facebook ad-api to autocomplete city name, however, the city id I get from facebook ad-api is not the same as what I get for the same city from graph-api. For example, pittsburgh, in graph-api, is 11493251851302, which I get from user's current living information. However, when I pull a list of city by ad-api, pittsburgh's key is 2512017. Is there anyway that I can convert between those two different id system? Thank you!

Related

Is there a way to get Online status via PlayerId in Gamesparks

I have a saved list of my friends name and playerId via Gamesparks. I want to know if they are online/offline. Can I do that using their respective playerIds ?
To lookup a player's online status using their ID:
Spark.loadPlayer(myPlayerID).isOnline()
SparkPlayer documentation

Get Another User's Information by Facebook Graph API

Hello I am new at facebook graph API
when I used url like this
https://graph.facebook.com/v2.7/me?fields=id,website,about,first_name,last_name,gender,birthday,education,age_range,email,%20television,movies,hometown,context,devices,favorite_teams,work&access_token=EAAM...
I can get website, first name , gender etc of me
but when I try to get another user's information from this url
https://graph.facebook.com/v2.7/{user id}?fields=id,website,about,first_name,last_name,gender,birthday,education,age_range,email,%20television,movies,hometown,context,devices,favorite_teams,work&access_token=EAAM...
I can get null values expect first_name, last_name and id
How can I correct the mistake?
Note : the other user allows to show this info.
Thanks

Not able to retrieve gender in google plus ios sdk

I used GTLQueryPlus.queryForPeopleGetWithUserId("me") for retrieving logged in user information. I am not getting the gender in json. When I set the gender visibility to 'public' instead of 'my circles' from my google plus profile, then I got the gender.
How to get the gender info without changing the settings from googe plus profile settings?
scopes used: signIn.scopes = [kGTLAuthScopePlusMe, kGTLAuthScopePlusUserinfoProfile, kGTLAuthScopePlusLogin];
You can only access what a user has set to public. If the user doesn't want this information public then you cant have the information.
Just because I authenticate your application doesn't mean that I want you to for example to see my address or in this case my gender. So I don't set them public you cant see them.

facebook v2.2 current_location is missing (no fql)

Before version 2.1 i was using fql to get user public information using the following code.
"https://graph.facebook.com/fql?q=select uid,name,current_location from user where uid = xxx"
Then i would parse the country, state and city from the response.
without fql we are using location field which leads to a page and the page gives longitude and latitude.
How do i get the country in v2.2 (The name or country code)
Thanks
You can easily get the location with Graph API using /user
refer to below link.
https://developers.facebook.com/docs/graph-api/reference/v2.2/user
https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=me%3Ffields%3Dlocation&version=v2.2&

Facebook API: how to post status update with location (latitude + longitude)?

Need to post status update and attach user location by passing latitude and longitude. In FB docs they say, we need to pass "place" FB entity that is:
"an object containing id and name of Page associated with this location, and a location field containing geographic information such as latitude, longitude, country, and other fields (fields will vary based on geography and availability of information)"
How to create/get such place name from latitude and longitude? I'v read related post1 and post2 but was not able to find a working solution.
How to create/get such place name from latitude and longitude?
There is currently no API available for developers to create Facebook pages or places. However, you can get place name by doing a FQL query like this...
'SELECT page_id,name,latitude,longitude FROM place WHERE distance(latitude, longitude, "LAT_HERE", "LON_HERE") < 250`
250 refers to the radius(m) that it will search within, it can go up to 50000.
Doing this FQL query will return you the Facebook Place Page's id, place name, latitude and longitude.
(Actually there is no need to get the place name as the page_id is what you really need. With page_id, you will be able to get all the information of that Facebook Place Page.)
Need to post status update and attach user location by passing
latitude and longitude.
Assuming you are actually trying to publish a checkin, you can refer to the references below to proceed further with the data you have obtained from the FQL query...
A normal status update(feed dialog) is different from a status update with location tagged to it(checkins), they are using different APIs.
References:
How to get place_id before checkin?
Facebook - Publish Checkins using PHP SDK/JavaScript SDK
Facebook Documentations
Page FQL - http://developers.facebook.com/docs/reference/fql/page/
Checkins API - http://developers.facebook.com/docs/reference/api/user/#checkins
If you have the lat/long data, you can search for the place and get the place-id which can be included in the POST message.
Please check these related posts -
https://developers.facebook.com/docs/opengraph/actions/#taggingplaces
https://developers.facebook.com/blog/post/2012/03/07/building-better-stories-with-location-and-friends/