Reputation: 289
I am totally confused with using the Facebook graph API. E.G. if I do this: https://graph.facebook.com/me/feed, I get:
{
"data": [
{
"id": "123456",
"from": {
"name": "Souvik Basu",
"id": "123456"
},
"story": "Souvik Basu shared \"jus'sayin\"'s photo.",
"story_tags": {
"19": [
{
"id": "123456",
"name": "\"jus'sayin\"",
"offset": 19,
"length": 11,
"type": "page"
}
],
"0": [
{
"id": 123456,
"name": "Souvik Basu",
"offset": 0,
"length": 11,
"type": "user"
}
]
But, how do I get a particular story in my android code? Also why are there 19th and 0th sory tags? I have the standard Facebook-Android code.
Upvotes: 1
Views: 3600
Reputation: 164129
I don't understand where exactly is your problem...
Are you using the facebook android sdk? If so, then it's very simple to get an graph object to your "android code", for example:
Facebook facebook = new Facebook(...);
String response = facebook.request("/me/feed");
JSONObject json = Util.parseJson(response);
JSONArray data = json.getJSONArray("data");
This example shows the normal API Requests but you can also use Async API Requests.
As for the keys of the story_tags, this is what it says in the documentation:
object containing fields whose names are the indexes to where objects are mentioned in the message field; each field in turn is an array containing an object with id, name, offset, and length fields, where length is the length, within the message field, of the object mentioned
Upvotes: 3