2

I'm using some fairly standard code to post to Facebook using the Social Framework. Running on my 6+, the code works as expected, and I can either cancel a post, or successfully post to my Facebook wall.

Problem: The completion handler should give a YES/NO result on whether the post is completed. But the handler returns YES (1) regardless of whether the user presses "cancel" or "post." I've tried a few versions of code I've found and I'm always getting a 1 regardless. The first post I've seen discussing this is just 5 days old -- is this a new bug? Is anybody else seeing this?

   SLComposeViewController *mySocialComposer;

if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
    mySocialComposer = [SLComposeViewController
                        composeViewControllerForServiceType:SLServiceTypeFacebook];
    [mySocialComposer addImage:[UIImage imageNamed:@"TOEICFlash.png"]];

    [mySocialComposer setCompletionHandler:^(SLComposeViewControllerResult result){
        NSLog(@"Completion handler = %li", (long)result);
        if (result == SLComposeViewControllerResultCancelled)
        {
            NSLog(@"The user cancelled.");
        }
        else if (result == SLComposeViewControllerResultDone)
        {
            NSLog(@"The user posted to Facebook");
        }
    }];

    [self presentViewController:mySocialComposer animated:YES completion:nil];

}
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Mike Critchley
  • 1,643
  • 15
  • 20
  • 3
    I'm having same problem also. But just a clarification it is only happening with Facebook, Twitter share is working fine. Do you have any progress regarding this issue? – mkeremkeskin May 06 '15 at 15:03
  • 2
    This seems to be an issue with how Apple is handling the response from Facebook. I advise posting on apple technical support: https://developer.apple.com/support/technical/submit/ – Shireesh Asthana May 07 '15 at 23:50
  • 1
    @keremkeskin I kind of gave up on fixing it for now. I suspect it may be because my app is still not released (although it's on iTunes ready for beta release). So the app I created on FB is not able to "see" the app ID, which may (??) be necessary for the ping back. Once I'm live, I'll keep working on it. – Mike Critchley May 09 '15 at 13:37
  • @ShireeshAsthana : Thanks a million for that advice. I'll do so tonight! – Mike Critchley May 09 '15 at 13:38

0 Answers0