Question

I'm using Social Framework on iOS 6 for Twitter integration, using the following code :

SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
controller.completionHandler = ^(SLComposeViewControllerResult result) {
    if (result == SLComposeViewControllerResultCancelled) {
      // cancelled
    } else if (result == SLComposeViewControllerResultDone) {
      // done
    } else {
      // unknown
    }
    [controller dismissViewControllerAnimated:YES completion:nil];
};
[self presentViewController:controller animated:YES completion:Nil];

If the user set the same tweet message as one of its old message, I get a popup "The tweet "xxx" is a duplicate and cannot be sent." but the completion handler result value is still SLComposeViewControllerResultDone. Is there a way to know if a tweet has really be sent ? It seems that the same behaviour is happening for TWTweetComposeViewController.

Was it helpful?

Solution

In iOS 5 twitter integration,

TWTweetComposeViewControllerResult just has 2 options

When user selects done -- TWTweetComposeViewControllerResultDone

When user selects cancel -- TWTweetComposeViewControllerResultCancel

This result doesn't depend on the tweets updated by apple in background. If the tweets fail while updating it shows an alert.

SO i suggest do not implement any custom pop-up for success or failure. As apple itself implemented indications for success/failure tweet updates. On success it plays a sound & on failure a pop-up with reason.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top