ShareLinkContent represents a URL you want to share to Facebook. You can attach a user-provided quote and a hashtag to the post.
Properties
| Property | Type | Description |
|---|---|---|
contentURL | URL? | The URL to share. The SDK checks it for App Links metadata. |
quote | String? | A quote displayed with custom styling on top of the link preview. Must come from the user — pre-filled quotes are against Facebook Platform Policy. |
hashtag | Hashtag? | A single hashtag attached to the share. |
peopleIDs | [String] | IDs of friends to tag in the post (requires Taggable Friends permission). |
placeID | String? | The ID of a place to tag. |
ref | String? | A string appended to the referrer URL when someone follows the link from feed. |
pageID | String? | Maps the app to a page for Messenger attribution. |
shareUUID | String? | A read-only unique identifier generated automatically for tracking purposes. |
Sharing a link
Create the content object
Instantiate
ShareLinkContent and set contentURL to the URL you want to share.Add a quote (optional)
The quote renders with highlighted styling above the link preview. It must originate from the user — do not pre-fill it.
Add a hashtag (optional)
Create a
Hashtag and assign it. The string must start with # followed by one or more word characters.The Hashtag type
Hashtag is a simple wrapper around a string. You initialise it with the # character included:
stringRepresentation matches ^#\w+$ — a single # followed by one or more word characters. Invalid hashtags are silently dropped during sharing.
Complete example
contentURL must be a network URL (not a file URL). The SDK validates this and throws if the URL is a local file path.