How to embed fbApp within fbPage in a specific way? - facebook

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

Related

Fanpage tab redirect to app canvas

We are creating a canvas app and would like to add directly to my fanpage.
There are 2 ways that I'm not sure about how to take the user to the app's fanpage.
First would be to create a tab and add it in the fanpage.
On this tab would have some text and a call-to-action to redirect to app canvas.
Would create a second tab and add it in the fanpage only with a redirect to take the user directly to the fanpage of the app.
Is there any documentation specific to this practice or some restriction to redirect the tab?
To see if your app was loaded inside a page tab, parse the signed_request server-side and look if there is a page-id set.
If so, answer that request with a minimal HTML document containing not much more than a piece of JavaScript code to redirect inside the top window instance, like this:
top.location.href = "https://apps.facebook.com/yourappsnamespace";
There should be no restrictions on that – Facebook is only worried about automatically redirecting users away from Facebook (to outside domains), but since you are redirecting to a canvas app, they stay on their site.
The docs clearly state:
We do not accept Canvas pages that redirect to Page Tabs, or vice
versa.

Adding Facebook Apps to Page Tabs

I have googled and googled around for this and found the blog post from Facebook about remove app profile pages etc. I also found that you can go to this link:
https://www.facebook.com/dialog/pagetab?app_id=[ID NUMBER HERE]&display=popup&next=[URL OF YOUR DOMAIN]
The problem is what do i put in URL OF YOUR DOMAIN. I cant put a site url in the app settings because its not a web site application, its a page tab application. Any combo of URL's i try, it just errors with "URL not owned by application"
Any ideas or experiences with this?
Use FB.ui method of JS-SDK with method pagetab as shown in example of Add Page Tab Dialog documentation this will automatically provide needed info to dialog.
FB.ui({method: 'pagetab'}, function(){
// User either closed dialog or added tab, you can call Graph API to check...
});
You have to register the URL first with Facebook and then use it. First go to http://developers.facebook.com. Then go to your app and hit [Edit App]. At the Basic Info section, you'll find a textbox requesting you to enter the APP Domain. Once you save it will work fine.
I simply entered www.my-domain.com, no http, no slashes.

How do you link to a page within a facebook iframe?

For example, I have the application starting at index.php. The user navigates to about.php within the iframe, likes that specific page and shares it. What would the structure of the url look like to take people clicking from their own timeline into that page of my iframe?
Thanks!
This depends, if you are on a FanPage it does not work (directly)
on a App Page its easy. You simpley dont link relative in your iframe, but outside to the facebook page itself, for this to work your Canvas url needs to be a directory.
Then you can link to ie. http://apps.facebook.com/yourcanvas/about.php (dont forget the target _top)
On a FanPage the only way i know is to use beside the tab setting, a canvas app page.
in your share code you set the app page as target (with parameter) and on the app page you set a session variable for the desired target and then redirect back to the fanpage.
on the fanpage you look if you have an target value in your session, if so redirect the user.

FB App works in Iframe, but doesn't appear when used as Page Tab

Okay, allow me to say first off that I am working on developing my first FB app/page tab at the moment. I'm not looking for anything fancy yet, just workability.
That being said, I have managed to create a FB app that loads from the hosting requested, and displays it under the app page. I have also made it so that I can add it as a page tab to FB pages. What I am having an issue with is that clicking on the page tab for the app, it does not show any content in the iframe on the page, though it shows on the canvas page for the app.
So, my question is, do you have any ideas as to why it might be showing on a canvas iframe and not the page tab iframe? I am currently guessing that it has to do with how the signed request is processed, but am not completely sure. I am using the PHP SDK for FB given here: https://github.com/facebook/php-sdk/ for the FB-related functions, and am tracing through that currently for where I might be going wrong.
Any help is appreciated. Thanks. =)
I had the same problem and was able to solve it by providing different (http vs https) URLs for the secure and non-secure canvas and page tab URLs. Just remove post the non-secure URL for the non-secure canvas/page tab URL fields. I believe this is because Facebook doesn't check to see if the user has secure browsing turned on until after they have logged in.
You could try to change the order of appear of the app tab; it worked for me.

FacebookSDK-5.0.25.0 for a Iframe Canvas App, after autherization user is redirected to canvas page

I am working on web application with .net 3.5 using C# facebook SDK. Loading page inside Page Tab iframe with some information, and input button, on click of button i am doing auth.Authorize() with some permissions, FB Permission window opens fine, but once user click on allow button it is redirecting to application canvas page instead of Page tab.
Is there anything i am missing?
Regards
Imran
Answer is to set auth.ReturnUrlPath which will bring user back to selected tab in facebook page. If your application is being added to multiple pages, then you can find out current pageid from "signed request" and set correct ReturnUrlPath, and attach ?sk=app_YOUR_APP_ID as querystring to ReturnUrlPath so current tab will be selected. your return path will look something similar to : http://www.facebook.com/profile.php?id=YOUR_PAGE_ID&sk=app_YOUR_APP_ID (make sure you handle both http and https)
This worked for me, hopefully will work for someone too.
-Ims
Facebook C# SDK doesnt support tabs.
Only canvas apps are supported.