我正在创建一个制作扇页的应用程序。用户可以在我的网站上创建他们的页面设计,并在发布按钮上点击该应用程序应添加到页面作为标签与设计制作。我有页面ID和应用程序Id。请建议一些方法,我可以通过它直接添加标签。同样,当我使用
http://facebook.com/add.php?api_key=app_api_key&page=page_id,
显示“添加应用程序”按钮,我可以更改该按钮的标签吗?
发布于 2012-02-19 20:55:24
通过使用以下调用,您可以通过编程实现这一点:
See here for acquiring page tokens (向下滚动到“页面登录”)
$page_token = 'XXX' // This is the page token
$app_id = '123456789' // This is the app that you want to install
$tab_title = 'My Tab Name';
// The following lines of code will install the tab app onto the page.
$install_tab_call = "/{$page_id}/tabs?app_id={$app_id}&access_token={$page_token}";
$facebook->api($install_tab_call,'POST');
// The following lines of code will update the tab app's name on the page.
$change_tab_call = "/{$page_id}/tabs/app_{$app_id}?custom_name={$tab_title}&access_token={$page_token}";
$facebook->api($change_tab_call,'POST');因为您正在使用这些命令来执行您的操作,所以您可以使用任何符合您需求的UI设计-不需要自定义Facebook UI。只需在调用上述脚本的页面上放置您自己的元素即可。我建议使用AJAX调用。
此外,您还可以在documentation:https://developers.facebook.com/docs/reference/api/page/#tabs中检出可以对页面选项卡进行操作的所有其他设置
请注意,您需要具有 manage_pages 权限才能执行处理页面设置的任何操作。
希望这能有所帮助!祝你编码愉快!
https://stackoverflow.com/questions/9348973
复制相似问题