2

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.

ΩlostA
  • 2,501
  • 5
  • 27
  • 63
  • The `FBSDKSharePhoto` class is the correct one if you are sharing just an image. Can you add to the question description exactly what issue are you running into? Is the image missing from the post? Is the SDK throwing an error? Add screenshots if necessary. – bangdel Oct 24 '17 at 14:29
  • @Bangdel Hi, I added some informations to the ticket. Do you think it is possible to use FBSDKSharePhoto without having the facebook app on the device ? (because I am not allowed to install it, asking of my customer). – ΩlostA Oct 24 '17 at 14:53

0 Answers0