Add UIImage directly into FBSDKShareLinkContent with Swift?
Appears that the FBSDKSharePhotoContent
is the way to go, but there is currently a bug that Facebook is aware of, which is causing the image & link to not work together.
https://developers.facebook.com/bugs/949486035103197/
They say this should be updated in the next Facebook app update v31. v30 was updated May 7 and FB releases updates every two weeks, so I'll check back in a week and confirm that the functionality is fixed.
Swift iOS Facebook SDK: How to share an animated GIF?
This is not as issue with your image due to Facebook
natively not support gif
image directly uploaded on it.
You can share gif
image link on Facebook
and it will show there gif image. Like as commonly peoples are using giphy, tenor website and share gif image link from this website. So gif image display via this type of website.
I hope this will help you.
Sharing content with facebook sdk 4.0 + iOS
There was a bug in the earlier version of FB SDK, but here it seems that you are missing a required implementation of a delegate methods.
FBSDKSharePhoto *photo = [[FBSDKSharePhoto alloc] init];
photo.image = //YOUR IMAGE photo.userGenerated = YES;
FBSDKSharePhotoContent * photoContent = [[FBSDKSharePhotoContent alloc] init];
photoContent.photos = @[photo];
FBSDKShareDialog *shareDialog = [[FBSDKShareDialog alloc] init];
shareDialog.shareContent = photoContent;
shareDialog.delegate = (id)self;
shareDialog.fromViewController = self;
NSError * error = nil;
BOOL validation = [shareDialog validateWithError:&error];
if (validation) {
[shareDialog show];
}
And implement the required delegates method
- (void)sharer:(id<FBSDKSharing>)sharer didCompleteWithResults:(NSDictionary *)results {
// handle
}
- (void)sharer:(id<FBSDKSharing>)sharer didFailWithError:(NSError *)error{
// handle
}
- (void)sharerDidCancel:(id<FBSDKSharing>)sharer{
// handle
}
Related Topics
Notification in Swift Returning Userinfo in Dictionary
Wait for Download Task to Finish in Nsurlsession
Uibutton Action Is Not Triggered After Constraint Layouts Changed
Issue with Returning a Directory Enumerator from Nsfilemanager Using Enumeratoraturl in Swift
Swift 4 - Hmcharacteristictypeserialnumber Deprecated
Localizing The Reading of Emoji on iOS 10.0 or Higher
Why Is My Libraries Not Able to Expand on The Cocoapods and Shows as Objective-C Not Swift
Swift Type Inference and Type Checking Issue
Using UIdropinteractiondelegate and Movies
How to Print Http Request to Console
Which Optimization Level Should I Choose for Release
Realm: Predicate Returning Lazyfiltercollection - How to Convert to Results<T>
Cocoa: Simulating Command+Tab in Cgevent
Using Multiple Hosting Controllers in Swiftui on Watchos
Is The for Loop Condition Evaluated Each Loop in Swift
Arkit - Raycasting Using a World Ray Instead of a Screen Point