Twitter login sometimes

I use simple Twitter login code

[[Twitter sharedInstance] logInWithCompletion:^(TWTRSession *session, NSError *error) {
        if (session != nil) {
            NSLog(@"successful %@",session);
        } else {
            NSLog(@"error: %@", error);
        }
    }];

and sometimes I get an error:

2016-08-04 15: 39: 14.472 MyProject [11143: 132894] [TwitterKit] made a meeting error with the message "Error trying to get temporary auth.": Domain error = NSURLErrorDomain Code = -1004 "Could not connect to the server." UserInfo = {NSUnderlyingError = 0x7fe043a49830 {Domain Error = kCFErrorDomainCFNetwork Code = -1004 "(null )" UserInfo = {_ kCFStreamErrorCodeKey = 61, _kCFStreamErrorDomainKey = 1}}, NSErrorFailingURLStringKey = https://api.twitter.com/oauth/request_token , NSErrorFailingURLKey = https://api.twitter.com/oauth/request_token, _kCFStreamErrorDomainKey = 1, _kCFStreamErrorCodeKey = 61, NSLocalizedDescription = Failed to connect to the server.} 2016-08-04 15: 39: 14.473 EarCrush [11143: 132894] [TwitterKit] encountered an error with the message "Authentication using the system failed account ".: Error Domain = NSURLErrorDomain Code = -1004" Could not connect to server ". UserInfo = {NSUnderlyingError = 0x7fe043a49830 {Error Domain = kCFErrorDomainCFNetwork Code = -1004 "( null)" UserInfo = {_ kCFStreamErrorCodeKey = 61, _kCFStreamErrorDomainKey = 1}}, NSErrorFailingURLStringKey = https://api.twitter.com/oauth/request_token , NSErrorFailingURLKey = https://api.twitter.com/oauth/request_token, _kCFStreamErrorDomainKey = 1, _kCFStreamErrorCodeKey = 61, NSLocalizedDescription = Failed to connect to the server.}

2016-08-04 15: 39: 14.473 Error MyProject [11143: 132894]: error Domain = NSURLErrorDomain Code = -1004 "Could not connect to the server." UserInfo = {NSUnderlyingError = 0x7fe043a49830 {Error Domain = kCFErrorDomainCFNetwork Code = -1004 "( null)" UserInfo = {_ kCFStreamErrorCodeKey = 61, _kCFStreamErrorDomainKey = 1}}, NSErrorFailingURLStringKey = https://api.twitter.com/oauth/request_token , NSErrorFailingURLKey = https://api.twitter.com/oauth/request_token , _kCFStreamErrorDomainKey = 1, _kCFStreamErrorCodeKey = 61, NSLocalizedDescription = Failed to connect to the server.}

I mean sometimes because:

  • 2 days ago I can log in to Twitter usually
  • ,
  • , () , .

Twitter Fabric (2.3), , -.

, , , - , , - .

+4
1

Twitter Firebase. :

Twitter.sharedInstance().startWithConsumerKey("key", consumerSecret: "secret")

AppDelegate. , , :

Twitter.sharedInstance().logInWithCompletion() { session, error in
        if let session = session { ... })

Fabric, Fabric.with([Twitter.self]).

+2

Source: https://habr.com/ru/post/1650143/


All Articles