-(IBAction)post:(id)sender
{
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
mySocialComposer = [[SLComposeViewController alloc]init];
mySocialComposer = [SLComposeViewController
composeViewControllerForServiceType:SLServiceTypeFacebook];
[mySocialComposer setInitialText:@"Hello World"];
[mySocialComposer addImage:[IIImage imageNamed:@"myImage.png"]];
[self presentViewController:mySocialComposer animated:YES completion:nil];
}
[mySocialComposer setCompletionHandler:^(SLComposeViewControllerResult result){
NSString *outout = [[NSString alloc] init];
switch (result) {
case SLComposeViewControllerResultCancelled:
outout = @"Post Cancled";
break;
case SLComposeViewControllerResultDone:
outout = @"Post Done";
default:
break;
}
UIAlertView *myalertView = [[UIAlertView alloc]initWithTitle:@"FaceBook"
message:outout delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
[myalertView show];
}];
}
我想在没有图像的情况下在 facebook 上发布一些内容,但是当我使用图像发布时它不起作用并给出错误警报。但是当我在帖子中添加图片时,它会成功发布。我只希望我发布没有图像。有没有办法做到这一点。?