質問

Every time I create a new Facebook app that integrates with a website I end up creating two, one to test in my debug environment (localhost/mysite) and another for production (www.mysite.com). This always comes in handy for the deployment/QA phase where the app is online, but you are still debugging. The downside, is that you have two apps to change settings, and allow/disallow it each time you switch. Would be a great speed increase if this were possible. Any way to use the same app?

My projects are in ASP.NET MVC on Windows (IIS) and VS2010.

役に立ちましたか?

解決

This worked for me, hope it's useful to others. There are couple of steps involved:

  • Hosts

    Add a subdomain of your URL to the hosts file

    127.0.0.1 debug.mysite.com

  • Visual Studio 2010

    I always use the VS Development Server, it allows me to simply debug by pressing F5. Use a Specific port and set the Start URL to the hosts file with port.

    Visual Studio Settings

  • Facebook Developer Dashboard

    In the Facebook Dashboard, choose your app and then click on Settings on the left menu. Add your domain to the App Domains (this allows you to use all subdomains), and the production URL in the Site Url.

    Facebook Settings

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top