TWTRLogInButton - error NSURLErrorDomain -1012

I get the following error:

Error: The operation could not be completed. (Error NSURLErrorDomain -1012.)

This error appears on the console when I click the "Sign in with Twitter" button, which is created in the same way (exactly as it appears in the application):

TWTRLogInButton* logInButton = [TWTRLogInButton buttonWithLogInCompletion:^(TWTRSession* session, NSError* error) { if (session) { NSLog(@"signed in as %@", [session userName]); } else { NSLog(@"error: %@", [error localizedDescription]); } }]; 

I do not see NSLog for error or "signed as% @".

Error starting application on iPhone 6S running iOS 9.1.

Cloth updated, version 1.12.0. However, I have the following warnings:

Umbrella header for TwitterKit module does not include 'TWTRDefines.h' header

Umbrella header for TwitterKit module does not include 'TWTRSession.h' header

I'm not sure if they cause a problem, but are skeptical of the simulator and other devices.

In the developer’s settings on the phone, I set “Allow HTTP services” to ON, and in the my.plist file I set the Allow Arbitrary Keys key to YES, as this turned out to resolve the problem earlier.

Any advice would be appreciated as I am truly lost.

+5
source share
3 answers

Here the error -1012 is discussed on the Twitter developers forum:

https://twittercommunity.com/t/ios-twitter-kit-1-10-1-twtrloginbutton-responds-with-1012-error/52766

I downloaded this sample project posted by user michalhernas who claims to replicate the problem: https://dl.dropboxusercontent.com/u/1824765/test-twitter.zip1

With the latest version of TwitterKit (1.13.1), the error message has changed to:

Domain error = TwitterAPIErrorDomain Code = 32 "Request error: unauthorized (401)" UserInfo = {NSErrorFailingURLKey = https://api.twitter.com/oauth/request_token , NSLocalizedDescription = Request failed: unauthorized (401), NSLocalized API failure Twitter: Failed to authenticate you. (code 32)}

So this is at least another mistake. I would follow the thread on Twitter. Funny, I tried to post it there, but got an error while trying to authorize the forum application.

+1
source

You may be able to solve the problem by completely removing the TwitterKit libraries from Xcode, uninstall the project from fabric.io, and make a new TwitterKit installation.

This is a problem on TwitterKit and is already under investigation https://twittercommunity.com/t/xcode-7-twitterkit-warning/52390

Change And, of course, what I always suggest is to delete the derivedData folder, a clean, clean build, restart Xcode and uninstall and reinstall the application.

+1
source

This could be an application security issue.

You can redirect domains to free them from this security or completely disable them. The following link describes how to solve this problem and how to solve it.

http://www.neglectedpotential.com/2015/06/working-with-apples-application-transport-security/

Hope this helps.

0
source

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


All Articles