I am using SLComposeViewController
to send a tweet. I have all the necessary permissions from Twitter to send a tweet, however, when I present the tweet sheet it never shows. From debugging my code I can see that the SLComposeViewController's
completion handler is automatically called at SLComposeViewControllerResultCancelled
is the result.
Has anyone come across this before? As I said, I have all necessary permissions and my Twitter account and password are set up correctly in my iPhone settings.
EDIT
This only happens sometimes. Majority of the time I have no problem with the Tweet sheet, so the code does work, but for some users they are experiencing this.
thanks
My code here:
- (void)presentTweetSheet {
SLComposeViewController *tweetSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
tweetSheet.completionHandler = ^(SLComposeViewControllerResult result) {
switch (result) {
case SLComposeViewControllerResultCancelled:
SWLog(@"Tweet Cancelled");
break;
case SLComposeViewControllerResultDone:
SWLog(@"Tweet sent");
break;
default:
break;
}
};
UIWindow *window = [UIApplication sharedApplication].keyWindow;
ECSlidingViewController *slidingVC = (ECSlidingViewController *)window.rootViewController;
[slidingVC.topViewController presentViewController:tweetSheet animated:YES completion:^{
SWLog(@"Tweet sheet displayed");
[self removeActivityIndicatorFromCell];
}];
}