adding facebook application as tabs - facebook

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 ...');

Related

How to embed fbApp within fbPage in a specific way?

how can I embed my app in my facebook page in a way as here:
www.facebook.com/SzkolaSTRAMA?v=app_323694844330149
I have attached the app to my page using the magic url:
http://facebook.com/add.php?api_key=&pages=1&page=
and tried to open somehow the app within using the v parameter, but it seems it is not that. Can someone give me a clue? Thanks.
Now you can add an application to a page in a page tab by going to below mentioned url
https://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID&next=YOUR_URL
You need to change "app_id" with your app_id, you can find it in app settings, "Your_url" should be replaced with your application complete url for e.g. "https://www.facebook.com/TestApplication?sk=app_389610254390000"
after changing values press enter, If you are admin of any Facebook page then you will be taken to a screen where you can select the page, after completion of this step your app will be added to page tab.
For further clarification go to this link
https://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID&next=YOUR_URL
YOUR_URL should be replaced with your Canvas url.
(The page that is being loaded into iframe on facebook)
APP_ID with id of the Page Tab application.
Explained also here
https://stackoverflow.com/a/10535905/1520297

After creating an app wont show app page in any links or url

I have made many apps and have many client pages, but for some reason I just created a custom tab and there is no visit app page link on left side. Also I typed in the url for the app page and it said "facebook app not found", but it shows if I add static html: I Frame tabs
Facebook announcing that they will remove all App Profile Pages on February 1st, 2012.
You will find answere here: https://developers.facebook.com/blog/post/611/
the profile page is normaly found via this url:
https://www.facebook.com/apps/application.php?id=your app id
The new applications won't get a page automatically ... to add you application check de docs here : https://developers.facebook.com/docs/appsonfacebook/pagetabs/
It is possible to create a page per application, these will be similar to normal pages ( or fan pages )
Hope this helps, cheers!

Facebook C# SDK, facebook app on fanpage redirects out of tab after login

I am working with the Facebook c# SDK (5.x). I have an app that runs on the fanpage in a tab. so far so good. when I ask for permissions, and i allow them, the user gets redirected to the app, but outside of the fanpage or tab.
Is there a way to stay inside the fanpage tab ?
What I did to solve this was to set the CancelUrlPath (in case user dont allow permission) and ReturnUrlPath(in case he does) to the page url/page and application url. Both attributes from CanvasAuthorizer object.
var auth = new CanvasAuthorizer();
auth.CancelUrlPath = "PAGEURL";
auth.ReturnUrlPath = "PAGEURL with active TAB";
auth.Authorize();
I guess this the solution for now, since c# sdk dont have a nice support for tab applications.
Hope this helps.

Forcing Visitors to Liking Facebook Page

I have a Facebook page.
We will start a giveaway. And we will give gifts to our Facebook Fans . They will give a promo code if like our page. BUt we want to sure, they are really fan of our fan page.
Because of this, I want to create a new tab which say "You have to like this page for get promotion code" to user . When visitor like our page, he / she can see content tab. If not, they can't see.
It was easy on static FBML, but know how can i do it with iFrame ? My tab is ready. Created a new app and then this app added to page.
you need to parse the signed_request parameter, it has a Boolean attribute called liked.
you may want to look at this question

Facebook Check if user "Liked" the page

I made a few Facebook FBML Canvas pages (Facebook considers these to be Applications) for a company, and they requested that users who "Like" the page would be redirected to another page, or the page will display different content with AJAX.
I went through the Facebook Developers Documentation, but I can't find a clue on how to do it.
I'm sure someone has done it before, any suggestions?
I found this on the Facebook forum I think it might help you out!
How can i redirect when someone like/share?
I haven't tried it myself though!
Good luck!
You can use either the JS or PHP sdk to check if a user liked a page. See examples below...
Uses JS sdk to check if a user liked a page (can be any page, just set the page id). This can be used in a standalone app or from within a page tab. - http://unbound-media.com/facebook/how-to-tell-if-a-facebook-user-likes-your-facebook-application/
Uses PHP sdk to check if a user liked the page from a tabbed app (can only check if user liked the current page they're on). This method can also be converted to JS. - How to check if a user likes my Facebook Page or URL using Facebook's API
If you are dealing with facebook app tab page, the following code helps you to find isfan status
$signed = parse_signed_request($_REQUEST['signed_request'], 'YOUR-APP-SECRET');
if ($signed['page']['liked'] == 1) {
$fan = true;
} else {
$fan = false;
}
Visit this link for demo and source code.