SLComposeViewController functionality no longer works as expected with the latest iPhone iPhone update April 24th. Any source code is ignored, although the setInitialText method returns true as if it were successful. The dialog box always returns Finish, whether you delete Finish or Cancel. I understand that this is an Apple call, and I donโt even use the Facebook SDK, but I confirmed that everything works fine with the previous version of the Facebook application, but when you update the Facebook application on your iPhone, this function no longer works as expected . Note that the result of the completion handler now always returns โDoneโ - even when you click โCancelโ, as well as setInitialText: does nothing. Checked that the same code worked until April 24th.
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]; }
source share