以编程方式向 Facebook 页面添加标签 [英] add a tab to facebook page programmatically

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

问题描述

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

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

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

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.

[已解决]
我想通了.

[solved]
I figured it out.

对 graph.facebook.com/me/accounts?access_token={access token} 进行 http 调用.使用通过先前调用检索到的访问令牌循环遍历结果,然后使用您要添加的应用程序的表单参数 {app_id} 将 http 发布到 graph.facebook.com/{PAGE_ID}/tabs.

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.

推荐答案

您可以通过向带有页面访问令牌的 PAGE_ID/tabs 发出 HTTP POST 请求,在页面的当前已安装选项卡列表的末尾安装 profile_tab:

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:

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

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

如果创建成功,会得到如下返回:描述 类型如果创建成功 boolean

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

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

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