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?
问问题
4124 次
2 回答
2
找到了解决方案
这只是一个简单的过程。我只需要使用这个链接(不需要调用 api)
当用户访问应用程序时(不是通过粉丝页面。可以使用“签名”检测应用程序何时通过粉丝页面运行request' .) 用户应转至此链接,
<script>
top.location = 'http://www.facebook.com/add.php?api_key=YOUR_APP_ID&pages=1';
</script>
它将显示 facebook 窗口,其中包含用户的所有管理页面,要求他将应用程序添加到他的粉丝页面的选项卡中。
于 2011-07-29T08:28:30.623 回答
0
实际上,似乎有一种方法可以使用 fb 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));
祝你好运!
于 2011-10-24T09:06:29.997 回答