我正在使用javascript sdk创建我的第一个facebook应用程序。我可以使用(FB.api('me/feed','post',))发布到用户的墙上。如何使用javascript sdk获取用户的帖子
现在我需要的是,当用户访问我的应用程序时,它必须显示(或列出)该用户的帖子。代码是
FB.api('/me/posts', function(response) {
for (var i=0, l=response.length; i<l; i++) {
var post = response[i];
alert('The value of post is:'+post);
if (post.message) {
alert('Message: ' + post.message);
} else if (post.attachment && post.attachment.name) {
alert('Attachment: ' + post.attachment.name);
}
} });
但它不工作。如果我删除l = response.length并将条件更改为i,则它将进入循环内部,但它会使post的值不确定。
我没有得到它为什么返回undefined。它也为post.message返回相同的值。
我也得到了用户的access_token。
如果我想让我的用户发布我需要使用的代码。任何人都可以帮助我。
在此先感谢
非常感谢@ PossiblyAnEngineer – 2013-03-05 07:16:12