ios plugin com.apple.share.Facebook.post do not show provided text

回眸只為那壹抹淺笑 提交于 2020-01-23 16:35:55

问题


In my app I'm using the following code that allows to share an image with a text:

- (IBAction)sharePressed:(id)sender {
    UIImage *postingImage = [UIImage imageWithContentsOfFile:self.filepath];
    UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[@"Lorem ipsum", postingImage] applicationActivities:nil;
    [self presentViewController:activityViewController animated:YES completion:nil];
}

And when posting I can see image, but can't see text. Also text doesn't appear in FB.


回答1:


I'm afraid to tell you, you cannot post text to Facebook programatically. It's a new Facebook prohibition that forbids "pre-filled" Facebook sharing. That is why newer versions of iOS do not show your text, even tough it's correctly provided (and works on Twitter and in other sharing options).

For more info please refer to https://developers.facebook.com/docs/apps/review/prefill)




回答2:


I first saw this when Facebook updated their app on April 24th. Plain text sharing to Facebook isn't working as long as the Facebook app is installed. After you delete it, it's available again.

If you try to share a URL or an image together with the plain text, you will see Facebook as an option but the text field will be blank. The image or URL will attach without a problem.

I posted a sample project that reproduces this problem on github:

https://github.com/djr/UIActivityViewController-Facebook

This is not an answer, but it's pretty clear that the problem is caused by the Facebook app.



来源:https://stackoverflow.com/questions/29875123/ios-plugin-com-apple-share-facebook-post-do-not-show-provided-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!