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

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.

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.

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

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.

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

Is user authorized, on Facebook tab

Getting an interesting error. I've been developing and application, and viewing it on it's page. Now I'm install that app in as tab on a company page and it's saying I can't use:
<fb:if-is-app-user>
in the tab view? How can I show or hide part of the page if the user viewing it is an app user?
FBML fan page tabs have been deprecated and replaced with Facebook iframe pages. To determine if the user is fan, you will need to decode the signed_request parameter that gets POST'ed to your webpage. There will be a "liked" variable in the encoded json payload. This page gives an example of how the new process works,