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,
        FacebookDelegate<IShareResult> callback = null
)
NameTypeDescriptionDefault

contentURL

Uri

The URL to which this post should link

null

callback

FacebookDelegate <IShareResult>

A delegate which will receive the result of the method call

null

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.