开发者

Getting friend's information from Facebook Graph API

Ok, I'm asking this question because I can only find examples and answers for the PHP version. I need the Flash version. I'm trying to get my friends information, but I think I'm doing it wrong because if I trace it, it'll give me either [object Object] or undefined.

I did Facebook.api("me/friends", handleApiGet);

private function handleGetApi(success:Object, fail:Object):void
{
    if (success)
    {           
        ExternalInterface.call("doAlert", success);
  开发者_C百科  }
    else
    {
        trace("nope");
    }
}

ExternalInterface.call("doAlert", success) returns me [object Object], [object Object]. I also did ExternalInterface.call("doAlert", success.name), it returns me undefined.

Any help will be greatly appreciated!


I haven't used the flash facebook bindigs yet, but according to your outputs and the graph api, the result will be an array, containing your friends list. Check it manual:

https://graph.facebook.com/me/friends?access_token=YOURACCESSTOKEN&format=json

According to your first result ( [object Object], [object Object] ) you received two objects, so success[0].name and success[1].name (or something like this) should return their names.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜