1

I am sharing a facebook page on my Timeline and holding a response in a callback. But each time it fails and callback response throws following error:

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 sub-domains of your app to the App Domains field in your app settings.

Here is the HTML Element on which I'm calling the method.

<a onclick="shareonfacebook()"><i class="fa fa-facebook"></i>facebook</a>

And this is the callback method for my facebook button

    function shareonfacebook(){
        FB.init({
            appId      : 'APP ID',
            xfbml      : true,
            version    : 'v2.8'
        });


        FB.ui({
            method: 'share',
            href: 'http://promo.globalhellogroup.com',

        }, function(response){
              if (response && response.post_id) {
                        alert('Post was published.');
                    } else {
                        alert('Post was not published.');
                    }             
  }
        });
    }

Response is always that error message.

Dashanan
  • 122
  • 3
  • 16
  • Could you specify the `error` parameter in your error callback and tell us which error you are getting back? (`error: function(error){.. console.log(error)..}` instead of alerting a custom string. – Ramiz Wachtler Apr 08 '17 at 06:59
  • 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 sub-domains of your app to the App Domains field in your app settings. – Dashanan Apr 08 '17 at 07:03
  • This error i have got on the dialogue. – Dashanan Apr 08 '17 at 07:03
  • Seems like you've to check the URL settings for the Facebook app (Site URL and OAuth URI). [This SO question could be related to your error](http://stackoverflow.com/questions/37063685/facebook-oauth-the-domain-of-this-url-isnt-included-in-the-apps-domain) – Ramiz Wachtler Apr 08 '17 at 07:08
  • I tried all solution that are suggested but nothing worked. – Dashanan Apr 08 '17 at 07:47
  • Can you show the screenshot of your settings page on the "Facebook Login" tab from the left sidebar? Also, paste the main domain on which this app is hosted. – Shuja Ahmed Dec 04 '17 at 08:04

0 Answers0