The functionality of SLComposeViewController no longer works as expected with the newest Facebook iPhone app update as of April 24th. Any initial text specified is ignored, though the setInitialText method returns true as if it was successful. The dialog then always returns "Done" whether you hit "Done" or "Cancel". I realize this is an Apple call and I'm not even using the Facebook SDK, but I have verified that everything works perfectly with the previous version of the Facebook App installed but when you upgrade the Facebook app on your iPhone, this functionality no longer works as expected.
Note that the result of the completion handler now always returns "Done" - even when you hit "Cancel" and also, the setInitialText:
does nothing now. Verified that the same code worked pre-the april 24th release.
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
[controller setInitialText:@"hiiiiiii"];
[controller setCompletionHandler:^(SLComposeViewControllerResult result)
{
if (result == SLComposeViewControllerResultCancelled)
{
NSLog(@"The user cancelled.");
}
else if (result == SLComposeViewControllerResultDone)
{
NSLog(@"The user posted to Facebook");
}
}];
[self presentViewController:controller animated:YES completion:nil];
}
else
{
SCLAlertView *alert = [[SCLAlertView alloc] init];
[alert showWarning:self title:@"alert" subTitle:@"facebook not installed" closeButtonTitle:@"ok" duration:0.0f];
}