我正在尝试使用用户Feed中的对象创建Facebook墙。然而,我似乎无法做的是得到张贴在我墙上的朋友的照片。
我目前正在使用if语句检查下面from属性的feed对象。我可以从from属性中获取id,但是如果我在循环中进行另一个api调用来构建墙,那只能让我得到它。但是,由于它是异步的,我无法返回值,我也无法将其与src属性连接起来。关于如何解决这个问题的任何建议?
{
"data": [
{
"id": "64582869534783990_343788612678878",
"from": {
"id": "32458397413435340",
"name": "User Name"
},
"message": "this is my message",
"actions": [
{
"name": "Comment",
"link": "https://www.facebook.com/144375679690/posts/245786252634978"
},
{
"name": "Like",
"link": "https://www.facebook.com/245786252634978/posts/245786252634978"
}
],
"privacy": {
"description": "Your friends",
"value": "ALL_FRIENDS",
"friends": "",
"networks": "",
"allow": "",
"deny": ""
},
"type": "status",
"status_type": "mobile_status_update",
"application": {
"name": "App Name",
"id": "245786252634978"
},
"created_time": "2014-11-08T22:26:06+0000",
"updated_time": "2014-11-08T22:26:06+0000"
}
]
}
答案 0 :(得分:0)
只需使用字段扩展
me/feed?fields=from{id,name,picture}