How to test Facebook App on localhost ?
Usually, in the past when I setup Facebook application for my websites. The new Facebook App Connect API has no problem allowing me to run tests with a live server. However, this time I need to run couple of tests for a new PHP project using Facebook Connect APIs on localhost server. To get this done, see the following steps.
Let say the app is located at
http:://localhost/fbapp
To make the Connect button returns back to the
http://localhost/fbapp
Under the target app settings. Change Site URL to
http://localhost/fbapp
On the machine that you are running the test. Edit the
/etc/hosts
file or if you are using Windows, editC:\WINDOWS\system32\drivers\etc\hosts
Add the line
127.0.0.1 localfbapp.com
This should trick Facebook Connect API to allow the tests to be run locally.
Hope this tutorial can be helpful.
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+10.4k Golang : How to get quoted string into another string?
+4.9k Golang : How to pass data between controllers with JSON Web Token
+7.6k Golang : Scanf function weird error in Windows
+9.1k Android Studio : Image button and button example
+10.1k Golang : Sort and reverse sort a slice of integers
+6.8k Golang : How to validate ISBN?
+11.9k Golang : How to detect a server/machine network interface capabilities?
+11.8k Golang : Concurrency and goroutine example
+8.7k Golang : How to check variable or object type during runtime?
+5.5k Golang : Intercept, inject and replay HTTP traffics from web server
+22.9k Golang : Round float to precision example
+7k Golang : Experimental emojis or emoticons icons programming language