Get post-id after adding FB.ui ()

I need to get post-id

after the user clicks a button share

. My code:

$("#share").click(function(e) {
  e.preventDefault;
  FB.ui({
    method: 'share',
    href: 'developers.facebook.com',
  }, function(response){
    if(response && !response.error_code) {
      console.log(response); // => []
    } else {
      alert('err');
    }
  });
});

      

After the content is successfully opened, the response I receive is an empty array with no data. How can I get a message post-id

from share

?

+3


source to share


1 answer


Check out the docs for information on the answer:

Only available if a user signed up to your app with Facebook and provided publish_actions. If present, this is the ID of the published Open Graph story.



Meaning, you will only get the post- / object-id if the user is logged in with permission publish_actions

.

+3


source







All Articles