Facebook local testing: In which direction data is flowing? - facebook

This question is not about how to set up local environment to test Facebook application. Rather I've already set this up with the help of this thread. In short I changed my hosts file and its working great.
But, I've a got a doubt:
Assumption: Everywhere I've read that Facebook server works like a proxy and fetches web-pages, like a web service, from application provider's server and then sends this embedded data to browser.
For testing purposes, I've changed my hosts file like mentioned in above thread. My question is if Facebook server is fetching data from my web server then how come my browser gets this data locally after changing hosts file?
It seems either my assumption is wrong or I am missing something fundamental. Please help. Thanks.

Facebook only acts as a proxy server if you are building an FBML app. If you are building an iFrame app, the request to your application is coming directly from the client browser. You can test this out by actually setting your canvas url to something like http://localhost:8080/ and running your app locally. You will be able to run the application like normal, but obviously only you will be able to use it since it is on localhost.

Related

How to test Facebook API actions locally?

I'm building a facebook app and so far so good but when I want to add an action (i.e. an article etc.) which would point to an outside url like "example.com/articles/12" it doesn't work since I'm developing using local urls like "localhost/dev/myprogram/articles/12" and Facebook obviously cannot fetch it.
What's a good way to solve this? Mind that the application doesn't exist on a live domain yet either, so I can't use that space.
I set up the app for the development with my localhost domain and since Facebook uses an iframe it works perfectly, but once I want to actually save objects it fails because of this problem.
so lets say I have an url like:
http://localhost/dev/myprogram/articles/12
then facebook first tries to parse it via
https://graph.facebook.com/?ids=http://localhost/dev/myprogram/articles/12&scrape=true
and then save the new object with something like
https://graph.facebook.com/me/myprogram:upload?article=http://localhost/dev/myprogram/articles/12
This will fail because even though Facebook can reach my localhost trough the iframe, it cant reach this page from anywhere else.
Any workarounds for this?
Thanks
What's a good way to solve this?
Either get some publicly reachable space to test your stuff on (could be a subdomain of your actual project domain, for example) – or set up your local development machine to be reachable from the interwebs, by using a DynDNS service of some sort.

Facebook.ui method: 'apprequests' hangs only on local development environment but not on anything else

I used this guide to set up the apprequest dialog. More specifically, I am using sendRequestViaMultiFriendSelector to allow a user to select multiple friends to send the app request to. https://developers.facebook.com/docs/reference/dialogs/requests/
I set this up almost a month ago and it's been working fine on my local development environment. However, today, for whatever reason, it just hangs. I can see requests going to Facebook and all the thumbnails being returned for my friends, but it doesn't seem to get past the 'loading' image.
The other weird thing is that on all my deployment environments (i.e., staging, production), it works just fine.
I checked the Facebook App I use for local development, and I'm not too sure how this happened, but the app id and app secret had changed. I've updated them accordingly but still to no avail.
Any ideas what might be the issue?
I experienced the same issue. The following solved the problem:
Define a custom domain in the hosts file (on the local computer),
as described earlier in this thread.
Configure Visual Studio to use port 80. Don't use a custom
(or random port).
Update the facebook App settings with the custom domain.
If you use a custom port, like 4543, the facebook dialogs will hang.
http://www.lazerwire.com
make sure that your local development server and the production (or any other server you want to run the script from) runs on the same domain (or subdomain of it) as the app domain that you've set in the application setting (in facebook developers site, http://developers.facebook.com/apps )
Another possible workaround is to set display:'popup' in the FB.ui call. The described bug does not occur for this display method.

Infinite Reload With Rotating State Param in Facebook Application

Infinite Reload With Rotating State Param in my facebook web app, this problem occur suddenly and suddenly all fb app on my server stop working
Page is refreshing again and again and not able to open ,
script work fine in other serverbut fails to work in this , is there any server config to handle facebook app.
You can chk issue at Link - gomandi.com/visit/
State Token is Refreshing again and again in all website hosted in my server , Looks like some Server confiG. issue is there . Can anyone help me with this.as i am my server support team unable to find this issue why my server fails to connect with fb server or viceversa.
SAME APP WORK IN OTHER SERVER !!
Based upon the comments on the question above, what you need to do is to create a brand new app for the different domain names. So you can have specific URLs for each domain specified in each of the app's app settings. So if there are three domains, then I'd recommend three apps configured correctly to point to each of those three domains.

Custom facebook page tab issue

So, for whatever reason, some people can't see the custom facebook page tab. Not sure why, especially when I can see it just fine.
Link: http://on.fb.me/rKNxUS
Let me know if you need more info.
Do you have a https version of the page tab? If they're account always uses ssl and you don't you might run into issues. Other times I've seen resetting the app secret help with issues like this.
It shows a standard browser error page to me. "This webpage is not available Google Chrome's connection attempt to incontrolwebsites.com was rejected. The website may be down, or your network may not be properly configured."
May it be possible you didn't upload the webpage to the production server?
If it opens correctly from your machine: check that you don't have a custom DNS setting to point to your local webserver instead of the production server.

How to do automatic functional test for Facebook Like button in local web server?

Our project is a Web application. We want to add Facebook Like button on our web pages. To test the functionality of Facebook Like works, we want to write some cucumber automatice functional tests.
The problem is, if a user (either real user or automatic test) click the Facebook Like button, the web page will send a message to Facebook server. And then Facebook server will callback to this web page to get some information (title/image/url/type etc, which are write in web page header meta tags). But our tests are running in local server, consequently the Facebook can not access. So there be something wrong.
So I'm wandering is there a solution to solve this problem. (Maybe not only for Facebook, but also any situation we want conversation between other systems and our local server)
In order for a Like Button to work, it has to be able to connect to the Facebook servers. There's no workaround, short of capturing the request and returning information, but I'm not even confident that would work. Can you not do the testing on a development server that can be accessed from the web?
You could .htaccess it so that only your team and the Facebook servers could connect to it.