I used that codes to publish an image without success:
Code on button click:
FBSDKSharePhoto *photo = [[FBSDKSharePhoto alloc] init];
photo.image = [UIImage imageNamed:@"Select.png"];
photo.userGenerated = YES;
FBSDKSharePhotoContent *content = [[FBSDKSharePhotoContent alloc] init];
content.photos = @[photo];
content.imageURL //property in read only
[FBSDKShareDialog showFromViewController:self withContent:content delegate:self];
Description:
I installed the SDF facebook, I put the keys in the plist, I put the appDelegate functions, and the #import in my main viewController. I added a button, and I added the piece of code in the button event.
Error message:
-canOpenURL: failed for URL: "fbauth2:/" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
[core] SLComposeViewController initWithServiceType: com.apple.social.facebook
[core] SLComposeViewController initWithServiceType got extension (null) for identifier com.apple.share.Facebook.post
[core] SLComposeViewController initWithExtension: (null) requestedServiceType: com.apple.social.facebook
-canOpenURL: failed for URL: "fbapi20150629:/" - error: "This app is not allowed to query for scheme fbapi20150629"
-canOpenURL: failed for URL: "fbshareextension:/" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
[core] addImage start
[core] viewWillAppear
[core] viewDidAppear
[core] ViewDidAppear, but remote VC failed, dismissing
[core] Sheet not being presented, calling premature completion
[core] SLComposeViewController completeWithResult: 0
[core] SLComposeViewController automatically dismissing itself
[core] SLComposeViewController dealloc <SLComposeViewController: 0x105644ed0>
OR:
//Facebook
FBSDKShareLinkContent *content2 = [[FBSDKShareLinkContent alloc] init];
content2.contentURL = [NSURL URLWithString:@"https://www.facebook.com/FacebookDevelopers"];
FBSDKShareButton *shareButton = [[FBSDKShareButton alloc] init];
shareButton.shareContent = content2;
shareButton.center = self.view.center;
[self.view addSubview:shareButton];
Thanks in advance.