mercredi 26 avril 2017

Using IP Address instead of Domain for Facebook Share API

I'm trying to implement Facebook Share API on my website and I seem to get this error whenever I trigger it. Based on my understanding I need to setup the domains inside the APP but what if it is a form of an IP address instead of domain with www

enter image description here

    <div class="share-social">
        <h3>Share your link directly:</h3>

        <ul>
            <a id="email" href="/#/refer" ></a>
            <a id="facebook"></a>
            <a id="twitter"></a>
        </ul>
    </div>

  window.fbAsyncInit = function() {
    FB.init({
      appId      : 'APP ID',
      xfbml      : true,
      version    : 'v2.9'
    });
    FB.AppEvents.logPageView();
  };

  (function(d, s, id){
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id;
     js.src = "//connect.facebook.net/en_US/sdk.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));


  document.getElementById('facebook').onclick = function() {
    FB.ui({
      method: 'share',
      display: 'popup',
      href: 'http://ift.tt/1nt9Vwm',
    }, function(response){});
  }




Aucun commentaire:

Enregistrer un commentaire