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 6367999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:37:12+00:00 2026-05-25T00:37:12+00:00

I am using Twitter+OAuth in my app. But I am getting following error in

  • 0

I am using Twitter+OAuth in my app.

But I am getting following error in my NSLog.

  Request E0B47D37-CE8C-406A-867E-2133E2469397 failed with error Error Domain=HTTP Code=401 "The operation couldn’t be completed. (HTTP error 401.)"

Coding : .h file

 #import "SA_OAuthTwitterEngine.h"
 #import "SA_OAuthTwitterController.h"

 @interface FirstViewController: UIViewController <SA_OAuthTwitterControllerDelegate,SA_OAuthTwitterEngineDelegate> 
 {
 SA_OAuthTwitterEngine *_engine;    
 }

Coding in : .m file

#define kOAuthConsumerKey  @"consumer_key"
#define kOAuthConsumerSecret @"consumer_secrect"

-(void)viewWillAppear:(BOOL)animated
 {


    if(!_engine)
   {
        _engine = [[SA_OAuthTwitterEngine alloc] initOAuthWithDelegate:self];
        _engine.consumerKey = kOAuthConsumerKey;
        _engine.consumerSecret = kOAuthConsumerSecret;
   }
 }

-(IBAction) buttonPressed
{
  if(![_engine isAuthorized])
        {
            UIViewController *controller = [SA_OAuthTwitterController controllerToEnterCredentialsWithTwitterEngine:_engine delegate:self];

           if(controller)
            {
              [self presentModalViewController:controller animated:YES];
            }
        }
        else
        {
            NSLog(@"twitter msg : %@",twitterMessage);
            [_engine sendUpdate:twitterMessage];

               UIAlertView *alert  = [[UIAlertView alloc] initWithTitle:@"Twitter" message:@"Post Successful" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
            [alert show];
            [alert release];
        }

  }
}


 #pragma mark SA_OAuthTwitterEngineDelegate

  -(void) storedCachedTwitterOAuthData: (NSString *)data forUsername: (NSString *)username
  {
        NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
        [defaults setObject:data forKey:@"authData"];
        [defaults synchronize];
  }

  -(NSString *) cachedTwitterOAuthDataForUsername: (NSString *)username
  {
        return [[NSUserDefaults standardUserDefaults] objectForKey:@"authData"];
  }

   #pragma mark TwitterEngineDelegate

   -(void) requestSucceeded: (NSString *) requestIdentifier
   {
        NSLog(@"Request %@ succeeded", requestIdentifier);
   }

   -(void)requestFailed: (NSString *) requestIdentifier withError:(NSError *)error
    {

        NSLog(@"Request %@ failed with error %@",requestIdentifier,error);
    }

What could be problem ?

  • 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-25T00:37:13+00:00Added an answer on May 25, 2026 at 12:37 am

    Generating new cosumerKey and secretKey may solve your problem.And sometimes server at twitter may also don’t respond so twit may not post

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting 401 when trying to login via Oauth with Twitter. I'm using
I am using Twitter+OAuth which uses MGTwitterEngine and SAOAuthTwitterEngine. My app works great in
I'm working on a twitter app for the iphone using oAuth/MGTwitterEngine The source it's
Hey I'm working on a twitter app for the iPad using the oAuth/MGTwitterEngine. It
I'm using Twitter's OAuth API to updates a user's twitter account (twitter status update)
I'm using Mirven's Twitter OAuth Sinatra example and trying to figure out how I
I have just succeeded in creating oAuth authentication for my twitter application using PHP.
I was using Twitter Oath for twitter sharing, suddenly the same code is getting
I am using Twitter Bootstrap in my rails app. My navbar looks perfect in
I am about to implement a twitter sharing functionality in my WP7 app, but

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.