Android: What is the share dialog class in Facebook SDK 4.x

后端 未结 1 1871
不知归路
不知归路 2021-01-12 08:01

I\'m using the code below to open Facebook share dialog with a Facebook page URL.

The problem is, when I look to the shared post on my wall via Facebook application,

相关标签:
1条回答
  • 2021-01-12 08:49

    From the Facebook documentation:

    Links

    When people share links from your app to Facebook, it includes attributes that show up in the post:

    • a contentURL, the link to be shared
    • a contentTitle that represents the title of the content in the link
    • a imageURL, the URL of thumbnail image that will appear on the post
    • a contentDescription of the content, usually 2-4 sentences

    If you want to display the image you should use setImageUrl(@Nullable final Uri imageUrl):

    ShareLinkContent linkContent = new ShareLinkContent.Builder()
                    .setContentUrl(Uri.parse(aFacebookPageURL))
                    .setImageUrl(Uri.parse(imageUrl))
                    .build();
    

    This is a share from SDK:

    enter image description here

    This is a share directly from the app:

    enter image description here

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