我正在使用SLComposeViewController发布到Twitter和Facebook。我的twitter和facebook都具有相同的代码,但是URL没有显示在twitter帖子中。我该如何解决?

Twitter代码-

socialController = [SLComposeViewController
    composeViewControllerForServiceType:SLServiceTypeTwitter];
[socialController setInitialText:@"Testing: This is the app link!"];
[socialController addImage:[UIImage imageNamed:@"image.jpg"]];
[socialController addURL:[NSURL URLWithString:@"http://www.google.com"]];
[self presentViewController:socialController animated:YES completion:nil];

Facebook代码-
socialController = [SLComposeViewController
    composeViewControllerForServiceType:SLServiceTypeFacebook];
[socialController setInitialText:@"Testing: This is the app link!"];
[socialController addImage:[UIImage imageNamed:@"image.jpg"]];
[socialController addURL:[NSURL URLWithString:@"http://www.google.com"]];
[self presentViewController:socialController animated:YES completion:nil];

最佳答案

SLComposeViewController将URL显示为tweet撰写 View 上的附件。发送后,URL将被附加到帖子的末尾。您甚至可以添加多个URL,它们仍将显示为附件。所以这就是应该的方式,没有任何要修复的东西。

关于iphone - iOS SLComposeViewController-Twitter帖子未显示网址,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/18744348/

10-10 15:24