0

This doesn't work anymore to share images. The image is not displayed in the FB popup window, nor does it gent sent to FB. The image is valid and the same code works for Twitter. Is there some new workaround to be able to share images to Facebook?

if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook])
    {
        SLComposeViewController *composeController = [SLComposeViewController
                                                      composeViewControllerForServiceType:SLServiceTypeFacebook];

        [composeController setInitialText:@"whatever"]; //this doesn't work either
        [composeController addImage:self.shareImageView.image];
        [composeController addURL:[NSURL URLWithString:@"https://whatever"]];

        SLComposeViewControllerCompletionHandler completionBlock = ^(SLComposeViewControllerResult result){

            if (result == SLComposeViewControllerResultDone) {
                //done
            }

        };
        composeController.completionHandler = completionBlock;

        [self presentViewController:composeController
                           animated:YES completion:nil];
    }

EDIT: If I remove addURL: it works. So is there no way to share an image along with a URL?

soleil
  • 12,133
  • 33
  • 112
  • 183

1 Answers1

0

Check this out: https://developers.facebook.com/docs/apps/review/prefill

"Add your own content to that which the user manually entered. This includes hashtags, hyperlinks or URLs." is considered a violation.

Bogdan Balta
  • 121
  • 9