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
+7.9k Javascript : Put image into Chrome browser's console
+6.2k Golang : Calculate US Dollar Index (DXY)
+5.7k Golang : Error handling methods
+7.4k Linux : How to fix Brother HL-1110 printing blank page problem
+36.7k Golang : Display float in 2 decimal points and rounding up or down
+15.9k Golang : Update database with GORM example
+15.2k JavaScript/JQuery : Detect or intercept enter key pressed example
+26k Golang : Convert IP address string to long ( unsigned 32-bit integer )
+4.9k Python : Convert(cast) bytes to string example
+13.8k Golang : Gin framework accept query string by post request example
+21.1k Golang : Sort and reverse sort a slice of strings
+24.5k Golang : Time slice or date sort and reverse sort example