正在使用 SLComposeViewController 将文章发布到 facebook 墙上。当在设备设置中关闭 facebook 的应用权限时,SLComposeViewController 仍然可以通过将文章发布到 facebook 墙上来工作。这是 SDK 问题吗?
SLComposeViewController *facebookViewController=[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook])
{
SLComposeViewControllerCompletionHandler __block completionHandler=^(SLComposeViewControllerResult result)
{
[facebookViewController dismissViewControllerAnimated:YES completion:nil];
switch(result){
case SLComposeViewControllerResultCancelled:
default:
{
[[[UIAlertView alloc] initWithTitle:@"Facebook"
message:@"Action Cancelled"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil]
show];
[self dismissView];
}
break;
case SLComposeViewControllerResultDone:
{
[[[UIAlertView alloc] initWithTitle:@"Facebook"
message:@"Posted to Facebook successfully"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil]
show];
[self dismissView];
}
break;
}};
[facebookViewController addImage:_shareImage];
[facebookViewController setInitialText:_shareTitle];
[facebookViewController addURL:_shareLink];
[facebookViewController setCompletionHandler:completionHandler];
[self.dashboard presentViewController:facebookViewController animated:YES completion:nil];
}