creating a tab page for a FB Pages app - facebook

I have created a FB Pages app and am trying to figure out why my tab html is not displaying.
when I go directly to my example.com/tab url that I have set in the facebook app settings I can see the expected HTML. When I go to my app tab on a sample facebook page I can see the request come for example.com/tab on my server as expected but nothing is displayed in the facebook page tab!
all I have is a simple
<div>hello world!</div>
and it doesn't display in the tab. Any idea why this is happening?

It's possible you don't have a valid SSL cert installed on your server. Or facebook may be caching an old URL. Check the URL it's trying to load in the iFrame to ensure Facebook is using the correct one.

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

Is it possible to use a locally hosted application on a page tab application during development?

I want to be able to display my application in an iframe via a page tab on someone's profile, I have a local version of my application running with SSL (although it is a self assigned certificate), on https://localhost:443.
When I set this url as the canvas url for the canvas page it works correctly, but as a page tab nothing is displayed. In fact upon inspecting the html where I believe the iframe should be there isn't even an iframe, and no actual request is being made to my application.
Does facebook make the request to the page tab url from their servers or something?? (as this would obviously mean you couldn't use a local version of your app). Or does it something to do with the markup my app is returning, as people on the net seem to be saying that you cannot return <html>, <body> or <head> tags to a page tab application.
Help. Please.
Yes this is possible by configuring "Page Tab URL" and "Secure Page Tab URL" in the application settings.
Once application is visited (both canvas and page tab) Facebook issuing POST request to your app, but it's still made by the User's browser.
Update:
This seems like a bug on Facebook end, if you'll visit your application page tab while browsing Facebook over HTTPS it'll work, but if you not using "Secure Facebook" the canvas isn't even requested. As a solution for development you can use Facebook over HTTPS or use HTTP version as "Page Tab URL".

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.

My App from Page Tab wont load it goes to http://www.facebook.com/common/invalid_request.php#

My Facebook App , on my Canvas loads properly. Both http and https AKA SSL. I then added the app to my Page as a tab. But when I click on the tab, All I get is a Facebook Logo Picture, when I follow the link i.e. Click on the Facebook logo link it brings me to https://www.facebook.com/common/invalid_request.php
I though it might be that the Canvas width size is like 720px, and I lowered my sites width to 520px, the size of pages.
A person in Augest had the same question:
Facebook Application Error In Page
I programmed a Facebook app, and i need to put in a Facebook page.
The application works great outside the Facebook page (standalone).
But when I try to access the application through the page's tab, Facebook's Logo (which linked to http://www.facebook.com/common/invalid_request.php#) appears instead of the app.
What could be the reason to this problem?
A Facebook app can have a different page tab URL configured which should be loaded when the App is loaded on a Page tab - is this set for your app? If so, it may not be set to the URL you were expecting (i.e it's not the same URL as your normal canvas app)
Also, when a page is loaded on a tab, a POST request is sent to your server with a signed_request callback, so your server or code may be expecting only a GET request.
Check these docs for more info:
https://developers.facebook.com/docs/appsonfacebook/pagetabs/ - note that the screenshots on this are currently out of date, i'll see if we can get them updated this week
https://developers.facebook.com/docs/authentication/signed_request/ shows the method to decode the info which is passed to your app on a page-tab load

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.