我使用社交框架实现了Facebook共享功能。我已使用设备设置配置了Facebook帐户。当我在设备上安装Facebook应用程序时,共享无法正常工作。
当出现共享窗口时,它只有用于共享的图像,没有初始文本和URL。
iOS8 - 如果我从设备中移除Facebook应用,则共享功能正常。
iOS7 - 即使Facebook应用程序在设备上,共享功能也能正常运行。
我不确定框架问题在哪里或者缺少什么?
SLComposeViewController *facebookShareVC = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
NSString *imagePath = [NSString stringWithFormat:@"%@/%@_%@_%@.gif", [[STInteractionManager sharedManager] getAppLibraryCacheDirectory], article.journalID, article.volume, article.issueNumber];
UIImage* img = [[STInteractionManager sharedManager] imageNamedFromDocuments:imagePath];
[facebookShareVC setInitialText:self.articleTitle];
[facebookShareVC addURL:[NSURL URLWithString:[self.url stringByReplacingOccurrencesOfString:@"?dispform=ios-device" withString:@""]]];
[facebookShareVC addImage:img];
[self presentViewController:facebookShareVC animated:YES completion:nil];
答案 0 :(得分:0)
如果您想预先填写字段,则根本不应使用Facebook SDK。相反,请使用Apple提供的Social框架。只需几行代码,就可以触发SLComposeViewController。