我建議你爲每篇文章創建一個facebook object
,並保留object id
,這樣你就可以「附上」評論,使得閱讀每篇文章的評論變得非常簡單。
代碼明智的,這將是流動:
當您創建了一篇文章,POST
in your PAGE FEED爲:
FB.api(
"/{page-id}",,
"POST",
{
"about": "Test about text",
"hours": "{'mon_1_open': '12:00'}",
"cover": "1234567890",
"offset_y": "45"
},
function (response) {
if (response && !response.error) {
/* response.id will have your post-id */
}
}
);
那麼簡單add comments到POST ID
像
FB.api(
"/{post-id}/comments",
"POST",
{
"message": "This is a test comment"
},
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
顯示all current comments ,只需撥打電話
FB.api(
"/{post-id}/comments",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
你甚至可以有一個新的表,你可以有internal_user_id
/comment_id
帶給所有用戶的意見爲Web應用程序...