编程添加选项卡到Facebook页面 [英] add a tab to facebook page programatically

查看:621
本文介绍了编程添加选项卡到Facebook页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个托管音乐的网站(stereokiller.com) - 示例乐段页面将 http:// www .stereokiller.com / rapture



我正在尝试创建一个Facebook应用程序,将插入一个新的选项卡到用户的乐队页面上加载播放器和我的网站的一些其他信息。但是,我不知道如何通过iframe应用程序的任何参数,以确定显示哪些频段信息?我知道FB_SIG_PAGE_ID,然后我可以从Graph API获取所有者页面名称,但如果我的网站上有多个乐队同名,那么我们可能有问题。任何想法?



-------------编辑



我想出来了。



对graph.facebook.com/me/accounts?access_token={access token}执行http调用。使用通过先前调用检索的访问令牌循环访问结果,然后对您要添加的应用程序执行http post到graph.facebook.com/{PAGE_ID}/tabs,格式为param {app_id}。


解决方案

您可以在最后安装一个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

这篇关于编程添加选项卡到Facebook页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆