If Facebook warns that to load this URL, add all domains and subdomains of your app to the App Domains field


I hate when instructions are so vague, you cannot figure out what to do. This is also the case with Facebook. After recent changes you may try to interact with your Facebook app only to receive a response saying “Can’t Load URL: The domain of this URL isn’t included in the app’s domains. To be able to load this URL, add all domains and subdomains of your app to the App Domains field in your app settings.” Now what? The solution is simple, provided that you know it. If not, you may search for hours without joy!

Go to the “Facebook Login” section of your app (if you don’t have this option in the sidebar, just create it using the “Products” menu (at the sidebar too). At the Settings of Facebook Login you find a text box under the label “Valid OAuth Redirect URIs“.

You need to paste there the redirection URI used by your plugin or by whatever code you try to use to interact with your Facebook app. If you have a Facebook button or link that communicates with your Facebook app, after this communication is complete, the script redirects you to some web address. Here is an example.

https://www.facebook.com/v2.10/dialog/oauth?client_id=63258914&state=c4b6ae7203&response_type=code&sdk=php-sdk-5.6.2&redirect_uri=https://www.thefreewindows.com/some-directory/some-page.php?page=AnExample&scope=email,manage_pages,publish_pages

This url contains the redirection uri, which is “https://www.thefreewindows.com” etc. You need to copy that, including the query (“page=AnExample”) and paste all of it into the “Valid OAuth Redirect URIs” textbox. You can have there more than one redirection addresses, so you don’t need to worry in case that your Facebook app is used by several scripts and sites. Facebook now forces us to use the complete URI, it won’t be enough to use only the domain name.

Enjoy!