iOS Twitter NSURLErrorDomain Code=-1012 - ios

I am trying to get the user's contact details by singning up with twitter in my app. I found this project on github which seems really good. I encounter only one problem. If I run it with my new app consumer secret and consumer key codes from twitter it gives me an error :
Error Domain=NSURLErrorDomain Code=-1012 "The operation couldn’t be completed. (NSURLErrorDomain error -1012.)" UserInfo=0x6898e80 {NSErrorFailingURLKey=https://api.twitter.com/oauth/request_token, NSErrorFailingURLStringKey=https://api.twitter.com/oauth/request_token, NSUnderlyingError=0x68980e0 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1012.)"}
The output in the console is :
2013-01-16 17:55:24.367 DMTwitterOAuth[3411:c07] current status = Prompt for user data and request token to server
2013-01-16 17:55:24.371 DMTwitterOAuth[3411:c07] current status = Requesting token for current user's auth data...
2013-01-16 17:55:25.433 DMTwitterOAuth[3411:c07] current status = Token received from server
Immediately after I get the alert view in which it says that it encountered a NSURLErrorDomain.
On the other hand, if I run it with some other codes from another twitter app it works, giving me all the details about the user. I just can't understand why for some keys it works, and for some others it doesn't.

Error code -1012 is kCFURLErrorUserCancelledAuthentication. This should mean that some code somewhere called [sender cancelAuthenticationChallenge:] in response to an authentication challenge. This is likely code inside of DMTwitterOAuth, but it's also possible it's Apple's own code inside the URL-loading system.

Make sure that your twitter application access settings are appropriate for what you're trying to do. If you're trying to post a tweet you'll likely need Read and Write access.
See the Application Model docs for more info.

It can be also just wrong authentication data in request header.

Visit the below url it solves the issue generally not in specific to this twitter context.It will give u some idea
https://stackoverflow.com/a/17920301/730807
I hope this helps..

I have recently found this problem occurring in projects where previously Twitter login was working. For this reason I assumed it was due to the change in iOS or maybe an upgrade in the Twitter feature.
One of the main issues is it is almost impossible to recreate this issue, there is a very interesting twitter community blog talking about it here: https://twittercommunity.com/t/ios-twitter-kit-1-10-1-twtrloginbutton-responds-with-1012-error/52766
The Twitter staff are trying to fix this issue but can't recreate it to see what is going wrong.
The problem seems to be that the users Twitter account has become disconnected from their device. This means that the Twitter Auth Helper can't get your details to login correctly.
The way to fix this is to go into settings -> Twitter and then click on your Twitter account name. For me this then prompted me to re-input my password as the account wasn't currently connected. Very frustrating and difficult to find as there is no indication until you click your Twitter account.
I found this solution applied when attempting to login with a Twitter account using Firebase.

According to Twitter, the fix is live in SDK version 1.14.1.

Related

Youtube API - iOS Key

We are using the google API library (objective-c) to try and access YouTube data. I have created an iOS key from Google Console, limited it to a specific bundle id and enabled it. Requests are failing with the error below. I know that it is a known issue while using bundle identifier to generate the key, but want to confirm if this issue still persists or it is resolved now and expected to work?
I tried experimenting from my side and came to the conclusion that it is still an issue. But just want to confirm if anyone tried recently and succeeded or have any workaround for this issue.Just want to ensure an extra security measure if it is resolved by now.
Error Domain=com.google.GTLJSONRPCErrorDomain Code=403 "The operation
couldn’t be completed. (Access Not Configured. Please use Google
Developers Console to activate the API for your project.)"
UserInfo=0xa3aa0e0 {error=Access Not Configured. Please use Google
Developers Console to activate the API for your project.,
GTLStructuredError=GTLErrorObject 0x8a74630: {message:"Access Not
Configured. Please use Google Developers Console to activate the API
for your project." code:403 data:1},
NSLocalizedFailureReason=(Access Not Configured. Please use Google
Developers Console to activate the API for your project.)}
Issues previously discussed:
Access not configured YouTube API
Access Not Configured Error, Even Though Access is Configured

Getting Error after redirecting to iOS app from google plus signin

I am using Google plus api signin in my iPhone app. Previous i created my app in google plus api using my gmail account. That time its worked good. But, due to some reasons I have added same app in my company account using gmail and I created new project in Google Plus Console and created new Client ID. And in Xcode plist i have changed all new client id which is given by google, but i am getting following error, could anyone have idea about this? IF so, please give your valuable suggestions.
Received Error Error Domain=com.google.GooglePlusPlatform Code=-1 "The operation couldn’t be completed. (com.google.HTTPStatus error 400.)" UserInfo=0x17da00a0 {NSLocalizedDescription=The operation couldn’t be completed. (com.google.HTTPStatus error 400.)} and auth object==(null)
After spending 4 hours on this issue, finally i fixed my issue. That issue came due to i did not entered details in Consent screen which is an option under API's & Auth.
I done simply, Clicked the Consent Screen option and added email in the "Email Adress field" and added Product name in the "Product Name field". Then save clicked.
Thats all. I hope this will helps somebody in future. I got this answer from following link
Error: invalid_client no application name

No Linked You tube account, Code=401 "The operation couldn’t be completed. While Searching videos

I am using YouTube Data API 2.1.
When I search for video without login everything works fine, I got all the video listed.
But when I try to search after login using an unlinked google account I got
Error Domain=com.google.HTTPStatus Code=401 "The operation couldn’t be
completed. ( NoLinkedYouTubeAccount
NoLinkedYouTubeAccount Error 401 )"
UserInfo=0x67cb240 {error=
NoLinkedYouTubeAccount NoLinkedYouTubeAccount Error 401
, NSLocalizedFailureReason=(
NoLinkedYouTubeAccount NoLinkedYouTubeAccount Error 401
)}
But when I create channel it worked fine.
How it is working when logged out, since this requires no user id:( . Also for searching public data no user id is needed as specified in documents.
Anybody faced the same issue? or am I completely wrong?
Please provide some guidance.
Check out the last comment here:
Previously, when using v=2.1 of the YouTube Data API, a "lightweight"
YouTube channel would be automatically created when there isn't
already a channel for a specific Google Account.
With the transition to linking channels with Google+ profiles, that
functionality has been retired. There are no longer auto-created
channels, and if you're getting that error, it's because there really
isn't an existing channel.
The issue has WontFix status and API 2.x has already been marked as deprecated, I guess the solution for you is to start using the newest API.

Twitter message posting issue ( Request failed with error: Error Domain=HTTP Code=410 "The operation couldn’t be completed. in ios app

One year back I have done one ios app and integrated the twitter+OAuth in the app . When I was releasing my app it is working fine . But now it is giving the error Request E51F2651-7D60-4670-9513-2D6494661959 failed with error: Error Domain=HTTP Code=410 "The operation couldn’t be completed. (HTTP error 410.)" . Can anyone please tell me how to solve this issue .
My app permissions in Twitter is Read, write, and direct messages and Request URI is api.twitter.com/1 . I have searched a lot about this issue . Most of the people are saying that we have to choose the application type to Client only but I didn't find this option in my twitter account . Please give me some guidelines .
It's not clear if you are using the iOS Twitter functionality, or another framework (but the oAuth makes me think it's another framework). The Twitter V1 API has been deprecated and retired. You should now use the 1.1 version:
https://dev.twitter.com/blog/api-v1-is-retired
This means the URI should have 1.1 in it, as opposed to just "1".
https://dev.twitter.com/docs/api/1.1
I would try updating the framework you are using, or perhaps switching to the built in Twitter functionality, which streamlines the authentication process if the user has a Twitter account on their phone.

iOS app:: Google+ integration- Daily Limit for Unauthenticated Use Exceeded

iOS app: - I am integrating google+ API in my iPhone application, i downloaded google+ API through this link:- "https://developers.google.com/+/mobile/ios/sdk/google-plus-ios-sdk-1.0.0.zip".
I have successfully integrated it in my code, but when i am trying to get user information, it is giving me error "The operation couldn’t be completed. (Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.)",
Any idea about this..!! Why this error comes.?
It says "All API calls require either an OAuth 2.0 token or an API key."
So you should get an API key and pass it as a parameter
https://www.googleapis.com/plus/v1/activities/z12gtjhq3qn2xxl2o224exwiqruvtda0i?key=YOUR-API-KEY
This issue happens when you are already logged in and still try to login again and again. I faced same error so did some experiments
1) I opened website on my mobile and everything was fine.
2) Then i tried on another laptop and used different gmail account to login and it again worked fine.
3) On my first laptop i tied again by clicking "Signin" button i got same error, so i opened google.com then logged out completely and then tried again, this time it worked.
So i believe, Issue is clicking login button again and again without logout.
I am not sure if this is a really a issue, but atleast this is what i found. I am still trying, trying and trying , will post if i found anything else.
Cheers !!

Resources