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

前提是你 提交于 2019-11-30 05:44:41

问题


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;

回答1:


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.



来源:https://stackoverflow.com/questions/19982288/ios7-slcomposeviewcontroller-error-posting-to-twitter-cannot-send-tweet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!