Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOS7 - SLComposeViewController - Error posting to Twitter - cannot send tweet - connection failed

I'm trying to implement a twitter post using IOS7 SLComposeViewController and I get the following error -

The Tweet "blah blah" cannot be sent because the connection to twitter failed.

I am including image and URL in my tweet - if that makes any difference..

code below -

SLComposeViewController *composeController = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];

[composeController setInitialText:@"i ran with 18 chickens under my armpits for 18 hours"];
[composeController addImage:[UIImage imageNamed:@"zoeLrg.png"]];
[composeController addURL: [NSURL URLWithString:
                            @"http://www.nme.com"]];

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

SLComposeViewControllerCompletionHandler myBlock = ^(SLComposeViewControllerResult result){
    if (result == SLComposeViewControllerResultCancelled) {

        NSLog(@"delete");

    } else

    {
        NSLog(@"post");
    }

    [composeController dismissViewControllerAnimated:YES completion:Nil];
};
composeController.completionHandler =myBlock;
like image 356
Dancer Avatar asked Nov 14 '13 15:11

Dancer


People also ask

Why are my tweets failing to send?

Twitter's installation files could've gotten corrupted, and the only way to fix it is by reinstalling the app. On Android, you can reinstall Twitter by doing the steps below. First, unlock your device and find the Twitter app from your app drawer.

Why is my Twitter not working?

Clear the app's data From your device's home screen, tap the Settings icon. Select Applications. Select the Twitter app, scroll down and tap Clear Data. If you've cleared your data but are still experiencing the issue, try turning your phone off and then on.

How do you send tweets on Twitter?

Type your Tweet (up to 280 characters) into the compose box at the top of your Home timeline, or select the Tweet button in the navigation bar. You can include up to 4 photos, a GIF, or a video in your Tweet. Select the Tweet button to post the Tweet to your profile.


1 Answers

Can you check your debug console to see what error is returned? Typically, those messages will be more informative. Also, if you have multiple accounts configured on your device, there is an open radar issue related to it which may apply in your case. Please check http://www.openradar.me/radar?id=5262535380959232.

like image 186
rajagp Avatar answered Oct 29 '22 22:10

rajagp