Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Test Facebook Connect Locally

Tags:

facebook

I use ASP .NET and Facebook Connect APIs. but when I run the app and press Connect button it's return to the Website not to the test local server which is (http://localhost:xxxx/test.aspx) So how I can test Facebook locally (i.e How I can change the callback url) ?

like image 709
Haytham Avatar asked Oct 04 '22 22:10

Haytham


People also ask

How can I login to Facebook in localhost?

You need to register as facebook developer and create you app there. Once you have your web app registered you can go to your app and click on add product. Add Facebook Login. Then enable Web OAuth Login and add your localhost in the textfield below and save, you should be able to access it.

How do I create a Facebook developer test?

Creating Test Users You can create test users in the App Dashboard by going to the Test Users section in the Roles > Test Users panel and clicking the Create test users button. This will open a dialog that allows you create up to 4 test users at once.

What is the test button on Facebook?

If you use the Facebook SDK or a Mobile Measurement Partner to send app events to Meta, or the Meta Pixel to send web browser events, you can use the Test Events tool to: Check that you've set up your app and web browser events correctly and we've received them. Debug any unusual activity.


Video Answer


2 Answers

It's simple enough when you find out.

Open /etc/hosts (unix) or C:\WINDOWS\system32\drivers\etc\hosts.

If your domain is foo.com, then add this line:

127.0.0.1    local.foo.com

When you are testing, open local.foo.com in your browser and it should work.

like image 54
freeall Avatar answered Oct 14 '22 07:10

freeall


Edit your app at www.facebook.com/developers/ and set the "Site URL" to "http://localhost/myapppath".

When done - change it back.

like image 31
Alex from Jitbit Avatar answered Oct 14 '22 06:10

Alex from Jitbit