我正在尝试通过社交媒体分享我的应用程序。特别是fb,但我不能分享我的帖子。
我需要点击我设计中特别给出的按钮..
我使用了下面的编码:
NSString *facebookShareLink = @"http://google.com";
NSString *titleToShare = @"Title";
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"fb://publish/profile/me?text=%@", facebookShareLink]];
if([[UIApplication sharedApplication] canOpenURL:url])
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:facebookShareLink] ];
} else
{
NSString *facebookLink = [NSString stringWithFormat:@"https://www.facebook.com/login.php?next=https%3A%2F%2Fwww.facebook.com%2Fsharer%2Fsharer.php%3Fu%3D%2525%2540%26t%3D%2525%2540&display=popup", facebookShareLink, titleToShare];
facebookLink = [facebookLink stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:facebookLink]];
}
取自 StackOverflow 本身..
谁能帮我解决这个问题..