通过 API 将 Facebook 应用程序添加到粉丝页面

发布于 2024-11-26 15:57:04 字数 289 浏览 3 评论 0原文

有没有办法通过 API 将 Facebook 应用程序添加到粉丝页面的选项卡?
我开发了一个应用程序。当用户访问该应用程序时,我需要显示用户的管理员粉丝页面并要求他选择一个页面。当用户选择一个页面并单击“添加”按钮时,我想添加应用程序进入选定粉丝页面的选项卡。
我知道如何使用 api 获取用户的管理员粉丝页面。而且我还知道使用“签名请求”检测我的应用程序何时通过粉丝页面运行。

那么谁能告诉我有没有办法通过 API 将 facebook 应用程序添加到粉丝页面?

Is there a way to add a facebook application to a tab in a fan page through API?
I have developed an app.When a user go to the app I need to display the admin fan pages of the user and ask him to select a page.When a user select a page and click "Add" button, I want to add application into a tab in selected fanpage.
I know how to get admin fan pages of the user using api.And also I know to detect when my app is running through a fanpage using 'signed request'.

So can anyone please tell me is there a way to add a facebook application to a fan page through API?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

坠似风落 2024-12-03 15:57:04

找到解决方案
这只是一个简单的过程。我只需使用这个链接(不需要调用api
当用户访问应用程序时(不是通过粉丝页面。可以使用 “签名请求”。)用户应定向到此链接,

<script>
        top.location = 'http://www.facebook.com/add.php?api_key=YOUR_APP_ID&pages=1';   
</script>

它将显示 Facebook 窗口,其中包含用户的所有管理页面,要求他将应用程序添加到其粉丝页面的选项卡中。

Found the solution
It just a straightforward process.I Just had to use this link(Doesn't need to call api)
When a user access the app(Not through a fanpage.Can detect when a app is running through a fanpage using 'signed request'.) user should derected to this link,

<script>
        top.location = 'http://www.facebook.com/add.php?api_key=YOUR_APP_ID&pages=1';   
</script>

It will display the facebook window with all admin pages of the user asking him to add app into a tab in his fan page.

莫多说 2024-12-03 15:57:04

实际上,似乎有一种方法可以使用 Facebook api,从而节省往返 Facebook 的时间。
答案尴尬地位于页面对象页面引用中(在“选项卡”->创建下)
https://developers.facebook.com/docs/reference/api/page/

您需要对 api 进行此类调用:

$appId = YOUR_APP_ID;
$pageId = THE_PAGE_TO_ADD_TO;
$apiUrl = "/".$pageId."/tabs";
$addedToPage = $this->facebook->api($apiUrl, "post", array("app_id"=>$appId));

祝您好运!

actually, it appears there is a way by using the fb api, which saves the round trip to facebook and back.
the answer is awkwardly situated in the page object page reference (under "tabs"->create)
https://developers.facebook.com/docs/reference/api/page/

you need to make this kind of call to the api:

$appId = YOUR_APP_ID;
$pageId = THE_PAGE_TO_ADD_TO;
$apiUrl = "/".$pageId."/tabs";
$addedToPage = $this->facebook->api($apiUrl, "post", array("app_id"=>$appId));

good luck!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文