Facebook app domain name when using localhost

前端 未结 16 668
说谎
说谎 2020-12-07 13:18

From a tutorial here:
http://ankurm.com/blog/api/using-localhost-for-facebook-app-development/1091/

I tried to set up a Local development Area for my Facebook

相关标签:
16条回答
  • 2020-12-07 13:54

    You must create a tunnel to share your localhost; Ngrok is maby the easiest way to do that.

    0 讨论(0)
  • 2020-12-07 13:56

    I develop locally and I use this URL: localhost/fb

    Then I had to add a website with the following URL: http://localhost

    Under App Domains I added localhost.

    Now it works. The only issue I had was, that you have to use this URL in all of your scripts. E.g.

    $loginUrl = $helper->getLoginUrl('http://localhost/fb/login-callback.php', $permissions);
    

    You can't use 127.0.0.1 here ...

    0 讨论(0)
  • 2020-12-07 13:57

    My solution:

    1. Leave App Domains empty
    2. (Products) Facebook login > Settings
    3. Add http://localhost:85/my_app/ to Valid OAuth redirect URIs box
    4. Save Changes
    0 讨论(0)
  • 2020-12-07 13:58

    This is what I used to do.

    If you are using Windows, you need to modify the host file. Host file location will be at %SystemRoot%\System32\drivers\etc\

    Add a new line in host file like this

    127.0.0.1    localhost.YOUR-SITE-NAME.com
    

    Save the host file.

    Go to FB apps setting control panel and give localhost.YOUR-SITE-NAME.com in Apps domain field. Save changes.

    Now load you local environment like localhost.YOUR-SITE-NAME.com from your browser.

    NB: change YOUR-SITE-NAME with your domain name.

    0 讨论(0)
提交回复
热议问题