我已经UIActivityController
在我的项目中添加了。看起来关于这个特定主题的帮助要少得多。我面临的问题是链接以一种奇怪的方式在 Facebook 上共享,而不是通常在 Facebook 上共享的方式。更有意义的是,照片和链接都在 iOS 照片文件夹中,没有任何更改它的选项。
以下是他们当前如何在 Facebook 上共享的示例图片:
它们通常如何在 Facebook 上共享以及我想要什么:
这是我用来在我的项目中添加 UIActivityController 的代码:
UIActivityViewController *objVC = [[UIActivityViewController alloc]initWithActivityItems:[NSArray arrayWithObjects:titleString, [NSURL URLWithString:urlString], imageTaker, nil] applicationActivities:nil];
[self presentViewController:objVC animated:YES completion:nil];
[objVC setCompletionHandler:^(NSString *activityType, BOOL completed)
{
NSLog(@"Activity = %@",activityType);
NSLog(@"Completed Status = %d",completed);
if (completed)
{
UIAlertView *objalert = [[UIAlertView alloc]initWithTitle:@"Alert" message:@"Posting was success" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[objalert show];
objalert = nil;
}else
{
UIAlertView *objalert = [[UIAlertView alloc]initWithTitle:@"Alert" message:@"Posting was not successful" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[objalert show];
objalert = nil;
}
}];
除此之外,我还在控制台中收到一些警告,如下所示:
Registering unknown app identifier com.apple.mobilemail failed
Unable to find app identifier com.apple.mobilemail
Registering unknown app identifier com.apple.MobileSMS failed
Unable to find app identifier com.apple.MobileSMS
更新:我也尝试过集成REActivityController
,一个实现相同但具有额外功能的库,但我面临同样的问题。