Share custom message, link and image on facebook via facebook sharer.php or using FB.api

前端 未结 1 1440
慢半拍i
慢半拍i 2021-01-29 03:37

I want to implement facebook sharing. I tried using the facebook sharer.php but it no more accepts custom parameters (deprecated by facebook). Also, I saw an option to use the F

相关标签:
1条回答
  • 2021-01-29 04:06

    Messages must be 100% user generated, prefilling is not allowed - if that is what you mean with "custom message". That being said, there is the FB.ui share dialog: https://developers.facebook.com/docs/sharing/reference/share-dialog

    It works similar to sharer.php and only takes the URL as parameter. That´s the recommended way, you just need to add the correct Open Graph tags to the shared URL.

    Another possible way to share something is to use the feed endpoint of the user object: https://developers.facebook.com/docs/graph-api/reference/v2.3/user/feed#publish

    ...but you need to authorize the user with publish_actions for that, and you have to go through a review process on Facebook before you can go public with that permission. Obviously, you will not get approved if you prefill the message parameter.

    More information about sharing in general: https://developers.facebook.com/docs/sharing

    0 讨论(0)
提交回复
热议问题