Overview
SharePhotoContent holds an array of SharePhoto objects to share as a Facebook photo post. You can share between 1 and 10 photos at once.
Module: FacebookShareDeclared in:
SharePhotoContent.swiftObjective-C name:
FBSDKSharePhotoContentConforms to:
SharingContent, SharingValidatable
Initializer
SharePhotoContent uses the default initializer. Create an instance and configure its properties directly:
Properties
The array of photos to share. Must contain between 1 and 10
SharePhoto objects. Validation fails if the array is empty or exceeds 10 items.An optional URL associated with the photo content. Checked for App Links meta tags.
An optional hashtag to include with the share.
User IDs to tag in the post. Defaults to an empty array.
The ID of a Facebook Place to tag with this content.
For Messenger shares, this page ID maps the app to a page and attaches attribution.
A unique identifier automatically generated for this share instance.
SharePhoto
SharePhoto represents a single photo. Only one source may be active at a time: image, imageURL, or photoAsset.
Objective-C name: FBSDKSharePhoto
Initializers
init(image:isUserGenerated:)
A
UIImage that is already in memory.true if the photo was created by the user, false if generated by the application. Platform policy (section 2.3) requires user-generated captions.init(imageURL:isUserGenerated:)
A file URL pointing to a photo on disk. Use this instead of a remote URL; to share a web image, download it first and use
init(image:isUserGenerated:).Whether the photo was created by the user.
init(photoAsset:isUserGenerated:)
A
PHAsset from the Photos library. Must refer to an image (not a video).Whether the photo was created by the user.
Properties
A
UIImage in memory. Setting this clears imageURL and photoAsset.A URL pointing to the photo. Setting this clears
image and photoAsset.A
PHAsset from the Photos library. Setting this clears image and imageURL.Indicates whether the photo was created by the user.
An optional user-generated caption for the photo. Pre-filled captions are not permitted by Platform Policies.