FB.ShareLink
Presents a Sharing dialog to the user allowing them to post content to their own timeline.
When called in the Unity Editor, a stub function is called instead.
Parameters
public static void ShareLink(
Uri contentURL = null,
string contentTitle = "",
string contentDescription = "",
Uri photoURL = null,
FacebookDelegate<IShareResult> callback = null
)
| Name | Type | Description | Default |
|---|---|---|---|
|
| The URL to which this post should link |
|
|
| The desired title of the content in the link | None |
|
| A short description, rendered below | None |
|
| A URL for the thumbnail image that appears on the post |
|
|
| A delegate which will receive the result of the method call |
|
Examples
Present the user with an opportunity to share a story to their timeline.
FB.ShareLink(
new Uri("https://developers.facebook.com/"),
callback: ShareCallback
);
More Examples
See additional FB.ShareLink examples at SDK Examples.
Best Practices
Shared stories are written in the voice of the user posting them, not the voice of the app (note that the example says "I thought" rather than "username thought"). Using sharing sparingly, and for high-quality content that a user would actually want to share, will increase the number of his/her friends who are likely to see and interact with the story. Make sure to watch your app's Analytics, and improve or remove story types that are ignored or disliked by your audience.