Check if Facebook app is in an iframe tab - facebook

I need my application to redirect to the site with the iframe tab (https://www.facebook.com/pages/namepage...idapp) when someone enters the app (https://apps.facebook.com/idapp)
How can I check if the app is open in an iframe tab?

The a page parameter in the signed_request will be present when the app is loaded via a page tab app, and won't be present otherwise.
Use this to determine if the app should render as a canvas app or a page tab app

Set up the canvas page URL in your app settings, and when that URL is called „redirect” the user via JavaScript, top.location.href = "//facebook.com/yourpageid/…"

Related

Added a Facebook Page Tab via self made app , but the iframe doesn't load the link in the App Settings

I created an application on Facebook and provided the following settings for page tab and added domains as www.glomania.com and page tab secure url to be also as https://www.glomania.com
My iframe does not loads anything after allowing the app on facebook page but the tab is added correctly. Please guide.
This is the app domain settings: https://i.stack.imgur.com/1xIUf.png
This is the app page tab settings: https://i.stack.imgur.com/Tdizk.png
This is the FB page where tab was added
https://www.facebook.com/Akasha-Chaddha-188152831757277/app/828591547345491/
Magento has a setting of Allow Magento to run from an IFRAME in System->Configuration
Set it to yes and you can overcome this warning

Redirect Facebook App to Facebook Canvas App (Fluid width)

I'm having a mental meltdown with Facebook and the way it handles Apps and Canvas Apps (apps with fluid width).
I can't figure out how to get a Page Tab to link to a fluid app. You can see an example on Coca Cola's fan page.
https://www.facebook.com/cocacola > Coce Zone tab
First it loads normal blank app which reloads to fluid app.
I have looked at the redirect code and it seems to be a form that submits itself after the page is done loading. After a bit of research I figured out that Facebook creates that itself.
My Page App directs to here but console says this:
Refused to display 'https://apps.facebook.com/ford-koeajotalkoot/' in a frame because it set 'X-Frame-Options' to 'DENY'.
In the app settings below the Page Tab there's Page Tab URL. There you must put an url to file with the redirect. It can be as simple file as below:
<script>
top.location.href="https://apps.facebook.com/YOUR_CANVAS_URL/";
</script>
It will then redirect to your app.

Facebook Page Tab/Facebook Canvas App/Fan Page

This all sounds confusing;
I have a Facebook Canvas App with the same name as the Fan Page. I would like to add an iFrame tab to the Fan Page to promote and link to the Canvas App. My question is do I have to create a new app for the iFrame tab, or do I open my app settings for the canvas app and add settings for a page tab as well in there. Facebook don;t seem to have much documentation and they are changing things for app profiles soon, so I want to make sure I keep my fans of the page.
Thanks in advance.
Basically it goes like this.
You have an iFrame app.
The iFrame app has a canvas which is where you load your html for your app from your webserver with whatever language you want (.NET, PHP etc)
Then you can add this iFrame app to your page.
When you go to http://apps.facebook.com/yourappname
You will be shown the app by itself. When you add it to your page and load it via the tab on the menu of your page it will show you the app within the space on your page (an iframe).
You can use code to detect whether you are on a page or not to display different things.

Facebook navigate into subpage of page tab app via Browser Url?

is it possible to access a subpage of a page tab app in Facebook via the browser URL? I've programed a lottery game where the users can share/like/send each single post to their wall/friends. The Like-Urls of the Posts link to the plain web-page out of Facebook (e.g. http://my-own-app.com/post/the-post-slug/). But I want to target the URLs to the page tab app directly so that the Facebook will passthrough the data to the app (loaded by iframe) e.g. http ://www.facebook.com/pages/My-Page-Where-the-app-is-included/123456789?sk=app_my-app&passthrough-url=http...
<- is sth. like this possible???
Thanks in advance,
greetings
mbx
This is covered in the Page Tab App Documentation near the bottom - see the section marked 'Integrating with Facebook APIs'
Short version: whatever you pass in the app_data parameter as a GET parameter will be passed to your app in the signed_request (in a parameter also called app_data) sent to your app.

Force facebook app to use page tab iframe

I have an iframe facebook app currently running on a page tab. Unfortunately, when people share some of the links within the page, the resulting shared links send users to the original content on the server and not to the facebook page tab. How can I force users who arrive directly at the URL into the page tab iframe?
I found the solution: basically you can use the facebook javascript api to detect if you are within the iframe. If not, redirect. Here is the code:
// Test if canvas page loaded
var obj = FB.Canvas.getPageInfo();
// Now redirect to page if not
if(obj.clientHeight == 0) window.location = 'http://facebook/page/url/';