Share button without app ID

Can i have facebook share button without app id? I have a facebook page and not an app and no app associated with it.

i has div

<div class="fb"></div>

      

and js file

$('.op-blackfb').click(postToFeed);

var postToFeed = function() {
    var share = {
      method: 'feed',
      u: 'http://mylink.goes/here'
    };
    FB.ui(share, function callback(response) {

        document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
    });

  }

      

This worked, but now it does not work with an error in the popup dialog, I guess after facebook changed the API. Does anyone know a workaround for this? I want to create a custom share button? I have a regular fb share button, but I want to have an image that doesn't break the design.

This works without app id but has a standard fb button

 <script>(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/de_DE/all.js#xfbml=1";
                    fjs.parentNode.insertBefore(js, fjs);
                }(document, 'script', 'facebook-jssdk'));

      

 <div id="fb-root"></div>
 <p id='msg'></p>
 <fb:share-button type="button" style="display:inline-block;" share_url="http://my.link/here"></fb:share-button>

      

Thank,

+3


source to share


1 answer


How about a modal iframe? You can use facebook sharer. You can use any button you want to open. The problem is that a facebook page is used for this, so you need to merge it into design with some iframe or you have to use a popup

https://www.facebook.com/sharer/sharer.php?u=[the-link-you-want-to-share]

      



Also the facebook documentation is also very well done

https://developers.facebook.com/docs/reference/dialogs/feed/

+3


source







All Articles