1

i am using below code to share fb feed

FB.ui({
  method: 'feed',
  link: 'https://developers.facebook.com/docs/',
  caption: 'An example caption',
}, function(response){ console.log(response); });

response is always null i could not figure out why , i think when share done it must output some response

ref link : https://developers.facebook.com/docs/sharing/reference/feed-dialog/v2.5

Please guide if i am missing something

andyrandy
  • 72,880
  • 8
  • 113
  • 130
saurav
  • 487
  • 1
  • 7
  • 21

1 Answers1

1

There is only a reliable callback if you authorized the user with the publish_actions permission. In that case, you will get the Post ID in the callback.

Else, there is no way to determine if a user shared something.

Keep in mind that you are not allowed to reward users in any way for sharing according to the platform policy: How to upload multiple images to one post in facebook via api

Community
  • 1
  • 1
andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • how to authorize users is explained very well in the docs: https://developers.facebook.com/docs/facebook-login/ – andyrandy Feb 25 '16 at 08:15
  • but you really need to answer my question: what for do you need to know if the user shared something? that´s a very important question. – andyrandy Feb 25 '16 at 08:15
  • if user shared something will some offer – saurav Feb 25 '16 at 08:28
  • ok, that´s why i asked. because it´s not allowed to reward users in any way for sharing. and you will never get publish_actions approved in the login review for this, so: not allowed and not possible. you MUST read the platform policy before creating any app. – andyrandy Feb 25 '16 at 08:29
  • users need to share only because they really want to, because your app is cool. create an app that users WANT to share ;) – andyrandy Feb 25 '16 at 08:39
  • hey bro i want to share my wbesite link not app – saurav Feb 25 '16 at 09:43
  • it does not matter what you want to share, app or website - either way, you have to create an app for your website to use FB.ui ;) – andyrandy Feb 25 '16 at 09:48