adding facebook application as tabs
I have developed an Facebook canvas page and i want to use that application as a tag on a fan page owned by me. That can 开发者_开发百科be done easily.
My doubt is that how do i make it sure that only i am able to add my application as a tab and not anyone else. I mean the method by which i would add the application as a tab on my profile page anyone can do it.But i only want that page to be visible on my Facebook fan page.
A bit late for you, but may be for others, I found out how to add my app to a new tab:
- You need to create a profile for the page admin! If you didn't, on the top right of Facebook page you should have a link 'Create Your Profile'. It doesn't make sense to me but ...
- Go to this link (thanks ifaour):https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&scope=manage_pages&response_type=token
- Got to your http://www.facebook.com/apps/application.php?id=YOUR_APP_ID and add the app to your page
For the private thing, you can check the page id:
$signed_request = $_REQUEST['signed_request'];
$secret = 'YOUR_SECRET_KEY';
$getdata = parse_signed_request($signed_request, $secret);
$fanpage_id = $getdata['user_id'];
if($fanpage_id != YOUR_PAGE_ID) exit('Sorry guys, that's just for me ...');
精彩评论