Can't login via Twitter Kit for iOS


#1

Edit: As usually with these things, once I press post I find a solution a few moments later…
Apparently it is possible to get the stored twitter account into a state where it has no password and twitter kit does not like that.

I work on implementing sharing to twitter and as a first step I integrated Twitter Kit using the Fabric app which eventually was happy with what I did.
The plist correctly includes the API Key and Token setup on the Fabric page (I also tried different ones for an application created on the twitter devloper application site).
Now whenever I try to login using the following code:

[[Twitter sharedInstance] logInWithCompletion:^(TWTRSession *session, NSError *error){
	if(session)
	{
		NSLog(@"signed in as %@", [session userName]);
		_accountSelectedBlock(YES);
	}
	else
	{
		DDLogWarn(@"Twitter login: %@", [error localizedDescription]);
		DDLogWarn(@"Twitter access denied or no account [%@,%@,%@]",[error localizedDescription],[error localizedFailureReason],[error userInfo]);
	}
}];

I am getting the following error in the callback (nearly immediately, without anything visible happening in the app):

e[fg204,121,32;2015-10-06 17:49:01:537 VeroShareManager[setupTwitter: line 150] Twitter login: The operation couldn’t be completed. (NSURLErrorDomain error -1012.)
e[;e[fg204,121,32;2015-10-06 17:49:01:539 VeroShareManager[setupTwitter: line 151] Twitter access denied or no account [The operation couldn’t be completed. (NSURLErrorDomain error -1012.),(null),{
NSErrorFailingURLKey = “https://api.twitter.com/oauth/access_token”;
NSErrorFailingURLStringKey = “https://api.twitter.com/oauth/access_token”;
NSUnderlyingError = “Error Domain=kCFErrorDomainCFNetwork Code=-1012 “(null)” UserInfo={_kCFURLErrorAuthFailedResponseKey=<CFURLResponse 0x13f7783a0 [0x1a11f4b68]>{url = https://api.twitter.com/oauth/access_token}}”;
}]

I suspect that something in my app is blocking whatever is supposed to happen, but I have no idea on what should happen (open the twitter app, browser or just some some view controller? Is there a user selection if the user has several accounts?) and what could block it…

Any help and or ideas would be great!
Thanks.


#2

Hey @Slin, I’m having this issue too. The Twitter folks are looking into it. See this other thread.


#3