I am able to add custom tabs to my Facebook pages, by using the Graph API, [https://graph.facebook.com/page_id/tabs] and using HTTP POST.
However, I am unable to add custom tabs to my Facebook application's profile page. Infact the API, [https://graph.facebook.com/page_id/tabs], with HTTP GET also fails.
(I mean, I cannot even get the tabs for my Facebook application's profile page with the API.)
What am I doing wrong?
Here I am listing what I am trying to do:
- I get an
access_token
(say a1) for a user (admin_user) using themanage_pages
permission. With this access_token (a1), I use Graph API, >[https://graph.facebook.com/me/accounts] and get back a list of pages (pages and application profile pages):
{ "data": [ { "name": "Bg", "ac开发者_如何转开发cess_token": "***", "category": "Industrials", "id": "*****" }, { "name": "Testapp2Pip", "access_token": "*******", "category": "Application", "id": "***" },
Now I use the Graph API, [https://graph.facebook.com/page_id/tabs]
Case 1. If I use the page_id
for the background page (which is a normal page) and the corresponding access_token, I get back the tabs for the page.
Case 2. If I use the page_id
for the Testapp2Pip page (which is an application profile page) and the corresponding access_token, I get an error:
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException"
}
}
What am I doing wrong here? How do I get the tabs for an application profile page? Also, I would actually want to add custom tabs to the application profile page by using Graph API.
Have you added the app to the app profile page, and/or double checked that it is added as an app? It seems odd, but you can add/remove the app from the apps own page. I'm guessing if the app isn't added, then it wouldn't have access to the page information.
An alternative option is to get an access token for the application, not the current user. This page has instructions for getting an access token for the app, instead of the user. Scroll down to the "App Login" section. http://developers.facebook.com/docs/authentication/
Okay, so this is a bug. I have filed the bug with Facebook.
精彩评论