Facebook share link - can you customize the message body text?

前端 未结 7 2179
我寻月下人不归
我寻月下人不归 2020-12-02 17:17

I\'m trying to create a link that will share a page on Facebook. So far I\'ve got:

href=\"http://www.facebook.com/sharer.php
?u=http%3A%2F%2Fwww.cnn.com%2F
         


        
7条回答
  •  萌比男神i
    2020-12-02 17:38

    Like @Ardee said you sharer.php uses data from the meta tags, the Dialog API accepts parameters. Facebook have removed the ability to use the message parameter but you can use the quote parameter which can be useful in a lot of cases e.g.

    https://www.facebook.com/dialog/share?
    app_id=[your-app-id]
    &display=popup
    &title=This+is+the+title+parameter
    &description=This+is+the+description+parameter
    "e=This+is+the+quote+parameter
    &caption=This+is+the+caption+parameter
    &href=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2F
    &redirect_uri=https%3A%2F%2Fwww.[url-in-your-accepted-list].com
    

    Just have to create an app id:

    https://developers.facebook.com/docs/apps/register

    Then make sure the redirect url domain is listed in the accepted domains for that app.

提交回复
热议问题