Sharing a TEXT alonsgide with a page text on FB and LINKEDIN?

后端 未结 2 1297
余生分开走
余生分开走 2021-01-27 07:45

I\'ve just stumbled upon sharing a text (a hashtag) togeher with a text on Facebook / LinkedIn. Here is hwat I am trying to do (hashtag: #STUFF):

  • 2条回答
    •  孤街浪徒
      2021-01-27 08:37

      Facebook

      Using sharer, you can only specify url, like so...

      https://www.facebook.com/sharer.php?u={url}
      

      Source: Facebook Sharer Documentation.

      BUT, if you register your app, get an app id, and install the Facebook share dialog plugin, then you have virtually unlimited access to specify sharing...

      https://www.facebook.com/dialog/share?app_id={app_id}&display={page_type}&href={url}&redirect_uri={redirect_url}
      

      Source: Facebook Dialog Documentation.

      LinkedIn

      So, you cannot really specify any text when sharing on LinkedIn. You can only set the url param. But you can set the og: tags to show title, image, etc., as a preview in your share page:

      • "com.linkedin.ugc.ShareContent": {
                "shareCommentary": {
                    "text": "Hello World! This is my first Share on LinkedIn!"
                },
                "shareMediaCategory": "NONE"
            }
        

        Source: Microsoft LinkedIn Documentation: Share on LinkedIn.

    提交回复
    热议问题