Chart API: Get Neighboring Places

Is there a way to go into lat / long and get a list of neighboring places using Graph API 2.1?

It was interesting that the user could register in the iOS application, but I would like to provide a list of the nearest places so that I know what place identifier should go to the feed endpoint.

https://developers.facebook.com/docs/graph-api/reference/v2.1/user/feed/

+8
facebook facebook-graph-api
source share
2 answers

Yes, it is possible if you can get the lat / lng coordinate from your device. Take a look at https://developers.facebook.com/docs/graph-api/using-graph-api/#search

GET /search?q={query}&type=place&center={lat},{lng}&distance={distance} 

You can leave a blank space {query} if you do not want to narrow down the results.

All API Graph search requests require the access token included in the request.

+22
source share

If you want to request the Facebook API to search for locations, you do not need a user access token, you can use your application token, which you will find here: https://developers.facebook.com/apps/{app_id}/settings/advanced under the client token

Assuming you have set up the Facebook SDK correctly, all you have to do is add your application token to your info.plist with the FacebookClientToken key. You should now be able to make graphics location API requests without user authorization!

Here is what your info.plist should look like:

 <key>FacebookAppID</key> <string>{{APP_ID}}</string> <key>FacebookClientToken</key> <string>{{CLIENT_TOKEN}}</string> <key>FacebookDisplayName</key> <string>{{APP_NAME}}</string> <key>LSApplicationQueriesSchemes</key> <array> <string>fbapi</string> <string>fb-messenger-api</string> <string>fbauth2</string> <string>fbshareextension</string> </array> 

Obviously, change anything between {{}} to the appropriate value.

0
source share

All Articles