且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

编程添加选项卡到Facebook页面

更新时间:2023-02-02 12:36:54

您可以在最后安装一个profile_tab通过向具有页面访问令牌的PAGE_ID / tabs发出HTTP POST请求,为页面安装的标签页的当前列表:



参数说明类型必需
app_id要为其安装选项卡的应用程序的ID。字符串Y



如果创建成功,您将获得以下返回:
描述类型
如果创建成功布尔


I have a site that hosts music (stereokiller.com) - a sample band page would be http://www.stereokiller.com/rapture .

I am attempting to create a facebook application that will insert a new tab into a user's band page on facebook loaded with the player and some other information from my site. However, i'm not sure how to pass the iframe app any parameters to determine which band information to show? I'm aware of the FB_SIG_PAGE_ID which i could then get the owner page name from the Graph API, but if there are multiple bands on my site with the same name then we could have issues. Any ideas?

------------- edit

never mind, i figured it out.

do an http call to graph.facebook.com/me/accounts?access_token={access token}. loop through results with the access token retrieved through the prior call, then do http post to graph.facebook.com/{PAGE_ID}/tabs with the form param {app_id} for the app of which you want to add.

feel free to share this!

You can install a profile_tab at the end of the current list of installed tabs for a page by issuing an HTTP POST request to PAGE_ID/tabs with a Page Access Token:

Parameter Description Type Required app_id ID of the application for which to install the tab. string Y

If the create is successful, you get the following return: Description Type If the create succeeded boolean