Add a custom application tab to user's pages
I am initially asking a
manage_pages
permission whenever a user is authorizing my app. I would now like to add a custom tab i.e. the user can change the name of the tab which get开发者_如何学Gos added to his facebook page. How can i achieve this?
Thanks Mirko... I checked the documentation and found that we can use graph api to make tabs as
$facebook->api("/PAGE_ID/tabs","post", array("access_token" => $accessToken, "app_id" => $appId));
though i was actually passing the 'user access token' in the above code instead of 'page access token as suggested by Lix in the other reply.
Fonally i found out that the page access token can be obtained by
$pageIds=$facebook->api('/me/accounts');
$pageAccessToken=$pageIds["data"][1]["access_token"];
$facebook->api("/PAGE_ID/tabs","post", array("access_token" => $pageAccessToken, "app_id" => $appId));
Facebook recently added the ability to programmatically (via the Graph API) create and modify tabs. Take a look at the tabs section of the Page docs: http://developers.facebook.com/docs/reference/api/page/#tabs
if you goto the page settings ( top right corner of page - "edit page" button), and then navigate to the "apps" tab - you can change the name of the tab that was added by clicking on "edit settings" next to its name.
精彩评论