0

I am using Facebook's SDK with Require JS and Backbone JS. I have a share button that triggers a fb share display. It shows up as expected, but does not give the option to share as a message. All other options (timeline,group,event,page) appear. Is there a reason why?

my facebook sdk load module (copied/generated from fb developer guide):

define(["facebook"], function(FB){
    FB.init({
      appId      : '', // my id is here
      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'));

});

and how I use it in a backbone view:

clickFbShareHandler: function() {
            var dialogue = "I got " + this.model.getValue()";
            FB.ui({
                method: 'share',
                mobile_iframe: true,
                href: '(my url)',
                quote: dialogue,
            }, function(response){});
        }

here is an image of the options given to me:

1 Answers1

0

You can use the Send Dialog for that: https://developers.facebook.com/docs/sharing/reference/send-dialog

Alternatively, you can use sharer.php, that´s what you saw on other pages. It just needs the url as parameter: https://www.facebook.com/sharer.php?u=[xxx]

andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • I saw this when looking earlier, but why I'm asking the question is when I hit share on say a buzzfeed article, all options come up. Additionally, it says that the share dialog should give the option for one to send as a message in the developer documentation. It says the send dialog should only be for content that one would normally email. I don't want to implement two buttons when one should do both. https://developers.facebook.com/docs/sharing/reference/share-dialog – vapurrmaid Jun 14 '17 at 22:52
  • ok, then it´s not the fb.ui share, but sharer.php. see the update in my answer – andyrandy Jun 15 '17 at 07:36