detect whether in facebook environment or not - facebook

I am developing a Facebook page and a website which is going to serve its contents to the Facebook page. I am using Zend Framework.
In order to use only one controller both for the website and the Facebook page, I would like to find some way to determine if the current user is navigating from Facebook or from the website. Thus, to hide some data if from Facebook and show other if from website.
Which is the best way to do this?

$_SERVER['HTTP_REFERER'];
If that doesn't answer your question I don't understand what you mean with "navigation from".

Related

Canvas App Like Button - use app URL or community page URL?

I've tried using both. If I like the URL for the app (http://apps.facebok.com/myapp) it counts the likes, but I don't get content from the community page. The community page was generated from the developer app tool for this app. If I use the URL for my generated community page, I do get posts to the community page. My only issue with that is Facebook automatically offers to share the URL when you like it now and the URL that gets shared doesn't take users directly to my app. Is there a setting that I missed to make this all work with the APP URL?
I have had a similar issue with this. You could share the URL to the community page and have that page redirect the user to your app. This way, any shared links will direct users to the app and you will get the content from the community page.
After much research (and looking at source for other Facebook applications) the answer is to create a community page named the same as you application and in your application use the like button with the URL of the community page. If you set it up properly, the community page can have a link to your app if it is on Facebook.
It feels like a huge mistake on Facebook's part to not have a better connection between the page URL and the community page. Perhaps this will improve in the future.

On Facebook is it possible to force an app to display as a page tab?

I have a Facebook app the currently consists of 3 elements - an App on Facebook, Mobile Web, and a Page Tab.
Currently if I use the app URL it detects whether I am on a mobile or not and directs me to either the app on Facebook or the mobile web site.
What I'd like it to do is always show the app in the context of the page tab. Is there anyway to force this?
I tried looking at whether I could use the page tab URL directly and have that redirect to the mobile but depending on how I've linked it either returns a 404 or just takes you to the Facebook page. I appreciate I could do my own mobile detection but I thought I'd check if I'm missing something in Facebook first.
I wrote an explanation of how to do this here: https://stackoverflow.com/questions/14434072/create-facebook-page-tab-and-publish-template-on-it/14455665#14455665
Hope this is what you are after!

How can I display comments from a facebook page on another company's website?

We are partnering with another company that has a page on Facebook, and we are looking for the best way to display the comments from that page on our website (and vice versa). What is the best way to do this since it is not our FB page?
Sounds like you just need a like box http://developers.facebook.com/docs/reference/plugins/like-box/
If you want more than that you basically have to implement a facebook application that can handle the data. Think of this as writing your own facebook client like a version of hootsuite. You will need full control of the target page to install the application.
Also when you say "our website" I assume you don't mean a facebook page.

Facebook Application - Like Button

I'd like to develop a Flash/Flex based application that I'll integrate withing my Page on Facebook.
I've seen on many applications that in order for a user too see more stuff on the application, user first of all has to click LIKE button on my page.
I've searched but couldn't find right thing I've been looking for, probably I don't know how to search for it correctly.
Maybe you could help me out to find right source for that.
I don't think Liking the app really matter.
What you might be looking for is authorization from the facebook users. For instance if your app need to post status update on the user's wall, you'll need to get authorisation from him/her first.
You should probably read this (rather generic) intro on facebook's developer website:
http://developers.facebook.com/docs/guides/canvas/
This might be a helpful read too:
http://developers.facebook.com/blog/post/116/
Finally, haven't done it in AS3 but apparently Adobe has an as3 version of the facebook sdk available:
http://www.adobe.com/newsletters/inspire/november2010/articles/article6/index.html
http://code.google.com/p/facebook-actionscript-api/
what you are reffering to is liking a page beofore being able to interact with an application that has been embedded into a page. A page tab app.
You need to parse the signed_request that facebook passes to your application and once you have parsed it you will be able to see if the user has liked your page or not.
Here is a link to some more information about singed_requests

How to add Iframe to my Facebook page

I am developing facebook application.I want to add iframe to my facebook page.I don't have any idea ,how to do it.I know we can not create a page using graph api or any api in facebook.
All the information you need is here - found by a quick google search:
http://developers.facebook.com/docs/reference/fbml/iframe/
You'll need your own hosting server which have HTTPS, and create your page with the language that they support and place the link points directly to the folder to facebook app setting. make sure your width does not go beyonds 520px for facebook custom tab page. if apps u can go up to 760px.
Hope that helps