简体   繁体   English

iOS-无法再将图像分享到Facebook?

[英]iOS - Can't share images to Facebook anymore?

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. 该图像不会显示在FB弹出窗口中,也不会发送到FB。 The image is valid and the same code works for Twitter. 该图片有效,并且相同的代码适用于Twitter。 Is there some new workaround to be able to share images to Facebook? 是否有一些新的解决方法可以将图像共享到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. 编辑:如果我删除addURL:它的工作原理。 So is there no way to share an image along with a URL? 因此,没有办法与URL共享图像吗?

Check this out: https://developers.facebook.com/docs/apps/review/prefill 检查一下: 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." “将自己的内容添加到用户手动输入的内容中。这包括主题标签,超链接或URL。” is considered a violation. 被视为违规。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM