Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1045411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:58:51+00:00 2026-05-16T15:58:51+00:00

I am working on a test app to help me better understand the way

  • 0

I am working on a test app to help me better understand the way oAuth works with the Twitter API for a bigger app I would like to write, however I am experiencing an issue posting messages to the API after successfully getting an access token.

I am using the OAuthConsumer framework as it seemed to be the easiest way to work through the yo-yo that is oAuth…

My code is further down, along with the console log, and I have included a link to a ZIP file of the XCode project.

http://dropbox.unknowndomain.co.uk/oAuth-Test-App.zip

Error:

Error Domain=NSURLErrorDomain Code=-1012 UserInfo=0x10029a100 "The operation couldn’t be completed. (NSURLErrorDomain error -1012.)" Underlying Error=(Error Domain=kCFErrorDomainCFNetwork Code=-1012 UserInfo=0x100296310 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1012.)")

This is the error I get back when it calls the API to send a tweet, now bear in mind that I have used this same exact code to call unprotected resources on the API with no problem and got a response just fine, however when sending a tweet I get an error which on closer investigation I got some hints of an error 401 which suggests the previous key is not valid, but I cannot imagine why.

I have been sitting on this for a week now completely stumped, so help regardless of experience might just uncover a hidden problem, that said a few people seem to have had this -1012 error on the Google Code page but there are no answers there.
`

Console Log:

2010-07-10 23:15:08.909 oAuth Test App[1732:a0f] Request Token: oauth_token=***&oauth_token_secret=***&oauth_callback_confirmed=true

2010-07-10 23:15:21.131 oAuth Test App[1732:a0f] Access Token: oauth_token=***&oauth_token_secret=***&user_id=***&screen_name=***

2010-07-10 23:15:29.439 oAuth Test App[1732:a0f] EPIC FAIL!

2010-07-10 23:15:29.440 oAuth Test App[1732:a0f] Access Token: <OAToken: 0x125408160>
2010-07-10 23:15:29.440 oAuth Test App[1732:a0f] Key: ***
2010-07-10 23:15:29.440 oAuth Test App[1732:a0f] Secret: ***

2010-07-10 23:15:29.440 oAuth Test App[1732:a0f] Service Ticket: <OAServiceTicket: 0x100296050>

2010-07-10 23:15:29.457 oAuth Test App[1732:a0f] Data: Error Domain=NSURLErrorDomain Code=-1012 UserInfo=0x10029a100 "The operation couldn’t be completed. (NSURLErrorDomain error -1012.)" Underlying Error=(Error Domain=kCFErrorDomainCFNetwork Code=-1012 UserInfo=0x100296310 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1012.)")

Thanks for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:58:52+00:00Added an answer on May 16, 2026 at 3:58 pm

    In fact while @skorulis is correct there is an issue with the signature provider, in terms of the Twitter API it seems that some parts of the API are happy with a Plain Text signature while others require HMAC-SHA1…

    Using this as the signatureProvider: will solve any issues including the above issue…

    [[[OAHMAC_SHA1SignatureProvider alloc] init] autorelease]
    

    Also there was a 2nd issue where the content downloaded from the server was not always complete, or was appended with junk text…

    The lovely people on IRC were able to help solve this, in the case examples it uses stringWithCString: which is depreciated and the alternative…

    stringWithCString:encoding: was also the wrong thing to use as it looks for a null character to end, luckily my app wasn’t crashing because of this but it was continuing to fetch memory until it found a character of this type, often for quite a while…

    Instead use:

    [[[NSString alloc] initWithData:data encoding: NSUTF8StringEncoding] autorelease]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working with Test::Unit and Shoulda. Trying to test Users.create . My understanding is that
I'm working on a test framework in Perl. As part of the tests, I
I have mocks working where I test that methods on my mocked object are
I use Assert.Fail a lot when doing TDD. I'm usually working on one test
I'm working on a little test application at the minute and I have multiple
I'm working with a ASP.NET MVC solution in a test driven manner and I
I've got 256 colors working great in my terminal ( test scripts here ),
I'm working on a project which I'm really not sure how to unit test.
My Django app started breaking all of a sudden and I cannot understand why.
I've got a simple command line Java JAX-WS app to test a SOAP request,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.