iOS: error message "[TwitterKit] did encounter error with message "Error obtaining user auth token.": Error Domain=TWTRLogInErrorDomain Code=-1 "

itunes sync error -54
itunes error codes
apple error codes
itunes error 78
the iphone could not be restored an unknown error occurred (9)
the iphone could not be restored an unknown error occurred (10)
apple error codes list
the software for the iphone was corrupted during download

I don't success to use the Twitter API connection in iOS with Objective-C. I use that codes:

[[Twitter sharedInstance] logInWithCompletion:^
 (TWTRSession *session, NSError *error) {
     if (session) {
         NSLog(@"");
     }}];

In my AppDelegate:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//Twitter
    [[Twitter sharedInstance] startWithConsumerKey:@"z0F**************cg" consumerSecret:@"PJu*******************N6W"];

- (BOOL)application:(UIApplication *)app
            openURL:(NSURL *)url
            options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options {
        return [[Twitter sharedInstance] application:app openURL:url options:options];

    return NO;
}

I precise that openURL is never called.

I obtain several error message that I don't understand:

Error Domain=TWTRNetworkingErrorDomain Code=-1011 "Request failed: unauthorized (401)" UserInfo={NSLocalizedFailureReason=Twitter API error : <?xml version="1.0" encoding="UTF-8"?>
<hash>
  <error>Desktop applications only support the oauth_callback value 'oob'</error>
  <request>/oauth/request_token</request>
</hash>
 (code (null)), TWTRNetworkingStatusCode=401, NSErrorFailingURLKey=https://api.twitter.com/oauth/request_token, NSLocalizedDescription=Request failed: unauthorized (401)}

AND:

 [TwitterKit] did encounter error with message "Error obtaining user auth token.": Error Domain=TWTRLogInErrorDomain Code=-1 "<?xml version="1.0" encoding="UTF-8"?>
<hash>
  <error>Desktop applications only support the oauth_callback value 'oob'</error>
  <request>/oauth/request_token</request>
</hash>
" UserInfo={NSLocalizedDescription=<?xml version="1.0" encoding="UTF-8"?>
<hash>
  <error>Desktop applications only support the oauth_callback value 'oob'</error>
  <request>/oauth/request_token</request>
</hash>
}

It seems that it is not connected, I see a lot of things in Swift, but nothing in Objective-C.

Thanks in advance.

If you read the manual https://dev.twitter.com/twitterkit/ios/access-rest-api

Check that user is logged :

NSString *userID = [Twitter sharedInstance].sessionStore.session.userID;
        TWTRAPIClient *client = [[TWTRAPIClient alloc] initWithUserID:userID];

Add these lines:

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

For the image, if you check that, it will help you: Posting image to twitter using twitterkit

[self tweetImage: [UIImage imageNamed:@"buttonRenault.png"]];

If you see an error when you update or restore your iPhone, iPad, or , Learn what to do if you see an error code or alert when you use your computer to update Plug your iOS device directly into your computer's USB port (not into an attached keyboard or USB hub). Then turn them on again. This error message appears in Mac OS X when syncing your iPhone to a Mac computer. It also contains a number in brackets, such as (13019). This error is letting you know that the iPhone can’t sync,

I get this error when i am try to integrate twitter login in my app

Solution :

1. When you create app on developer account of twitter, that time Callback Url field is not wants to empty. If this field is empty that time this issue comes so to overcome on this issue please don't be empty this callback url field.

  1. This error sometimes comes when twitter consumer key or twitter secret key is mismatch. So check Both Scenario.

Happy Coding....!!!

Understanding iPhone and iOS error messages, However, with our guide to iOS error messages you'll soon know what each iPhone error message means. Sometimes it will appear on the iPhone screen as an alert, sometimes it will appear on the Mac screen when you connect an iPhone to a Mac. The iPhone error message may say something like "The iPhone cannot be synced. Alerts. Alerts convey important information related to the state of your app or the device, and often request feedback. An alert consists of a title, an optional message, one or more buttons, and optional text fields for gathering input. Aside from these configurable elements, the visual appearance of an alert is static and can’t be customized.

    AppDelegate:
        func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

        TWTRTwitter.sharedInstance().start(withConsumerKey:"xxxx", consumerSecret:"xxxxxxxxxxx")
            return true
        }

        func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
            return TWTRTwitter.sharedInstance().application(app, open: url, options: options)
        }

    ViewController

       @IBAction func twitterClick(_ sender: Any) {
            // Swift
            let composer = TWTRComposer()

            composer.setText("just setting up my Twitter Kit")
            composer.setImage(UIImage(named: "twitterkit"))

            // Called from a UIViewController
            composer.show(from: self.navigationController!) { (result) in
                if (result == .done) {
                print("Successfully composed Tweet")
                } else {
                print("Cancelled composing")
                }
            }
        }

        @IBAction func logOutUserTwitter(_ sender: Any) {
            // Swift
            let store = TWTRTwitter.sharedInstance().sessionStore

            if let userID = store.session()?.userID {
                store.logOutUserID(userID)
            }
        }

 Info.plist
<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>twitterkit-<xxxx></string>
    </array>
  </dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>twitter</string>
    <string>twitterauth</string>
</array>

Settings Twitter page develop:
Callback URL enter http://localhost

https://github.com/twitter/twitter-kit-ios/wiki/Installation

Did your iOS update fail? Here's how to troubleshoot, Read on as we walk through a few common problems and solutions Another common error while trying to update to a new version of iOS is  Your iOS device has a dirty or damaged connector. Try these steps to fix the issue:

From June 12th 2018 callback locking will no longer be optional. The correct callback format for iOS apps is:

twitterkit-MY_CONSUMER_KEY://

https://developer.twitter.com/en/docs/basics/developer-portal/guides/callback-urls

Error occurred installing iOS 13 or iPadOS on iPhone or iPad? How , On your iPhone or iPad, go to Settings > [your name] > iCloud > iCloud Backup. You can also use your computer, Mac or PC: Connect iPhone or  Every so often when you go to refresh your emails from the Mail app in iOS, you may get an error message like the one shown above that reads, “ Cannot Get Mail. The mail server imap.gmail.com is not responding. Verify that you have entered the correct account info in Mail settings.

disable in twitter this: Enable Callback Locking (It is recommended to enable callback locking to ensure apps cannot overwrite the callback url) and paste something to the callback url

iOS: Unable to Install Update: An error Occurred Installing , When YouTube can't complete the action you've taken, an error message may appear on your device. There are many root causes of error messages, many of  Fake iPhone Text Generator iOS Clone. Worlds first iOS text message generator. Even though they updated to iOS ages ago, people still seem to post these fake old iPhone messages everywhere. We grew tired of that so we decided to make an upgraded generator that supports iOS7 elements to make fake iPhone text messages.

Troubleshoot YouTube error messages - iPhone & iPad, If you're facing the same error when trying to install the iOS beta 13 software on your iPad or iPhone, then this post is for you. Read on and  Update the iOS software of your iOS device to the most recent version that is available. Go to your “Settings” Tap “General” Tap “Software Update” If you find an existing update, carefully follow the instructions as given. Turn off Calendars from Your Account Then Turn it on Again. Go to your “Settings”

What to do if an error occurred installing iOS 13 on your iPhone / iPad, iOS Push Troubleshooting Error Messages The Test Notifications tool runs checks of your device settings, device connection, connection to Duo's cloud service,  While it’s no technology device, this utility is critical to a lot of iOS users, especially the one that do not have a jailbroken iPhone or iPad. In fact: Even if you have a jailbroken iOS device, Cydia Impactor can really be helpful as we all know AppSync Unified still hasn’t been updated for iOS 10. Good News!

Troubleshooting Duo Push notification issues on iOS devices, 1 on an iPhone 6s Plus, and also my iPhone Xr. When choosing to verify iOS 13 update, and error pops up - "Unable To Install iOS 13.4.1 Update 

Comments
  • Oh very good, it works very well. For info, I took that answer in your ticket: stackoverflow.com/a/39234370/3581620