Overview
ShareLinkContent holds the data for a standard Facebook link share. Set at minimum the contentURL property, then pass the object to a ShareDialog.
Module: FacebookShareDeclared in:
ShareLinkContent.swiftObjective-C name:
FBSDKShareLinkContentConforms to:
SharingContent, SharingValidatable
Initializer
ShareLinkContent uses the default memberwise initializer. All properties have default values, so you can create an empty instance and set properties directly:
Properties
The URL to share. This is the primary required field for most share modes. The URL is checked for App Links meta tags to enable deep linking. Pass a valid
https URL.Optional text to display alongside the link. When specified, the quote appears with custom styling on top of the link preview.
For shares into Messenger, this page ID maps the app to a page and attaches attribution to the share.
An array of user IDs to tag in the post. Users must be taggable friends. Defaults to an empty array.
The ID of a Facebook Place to tag with this content.
A value appended to the referrer URL when a person follows the shared link from their feed.
A URI identifying the resource at
contentURL, used for resource-level linking.When
true, the SDK is allowed to attach background music to the share. Defaults to false.A unique identifier automatically generated for this share instance. Useful for analytics and tracking.
Hashtag
Hashtag represents a single hashtag to include with shared content.
Objective-C name: FBSDKHashtag
Initializer
The hashtag string, including the leading
#. Example: "#SwiftDevelopment". Invalid hashtags (those not matching #\w+) are silently ignored when sharing.Properties
The raw hashtag string as provided to the initializer.
true if the hashtag matches the pattern #\w+ (a # followed by one or more word characters).Validation
When you pass aShareLinkContent to a ShareDialog, the SDK validates the content before presenting the dialog. The contentURL, if provided, must be a valid network URL. If contentURL is nil, validation passes and the dialog may still be shown in some modes.