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

  • SEARCH
  • Home
  • 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 9267335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:31:39+00:00 2026-06-18T14:31:39+00:00

I know this is going to seem like a duplicate question, but I’ve looked

  • 0

I know this is going to seem like a duplicate question, but I’ve looked at every single question on stack overflow relating to this and I’m still getting the following error:

Error Domain=com.facebook.sdk Code=2 "The operation couldn’t be completed. 
(com.facebook.sdk error 2.)" UserInfo=0x1ecbf8e0       
{com.facebook.sdk:ErrorLoginFailedReason=com.facebook.sdk:ErrorLoginFailedReason}

That’s the entire NSLog of the NSError..

I have followed the tutorials for authentication to the letter;

  • On developers.facebook.com I have made my application a Native iOS app, and put in my bundle id
  • In my info.plist I have included the URL types > Item 0 > URL Schemes > Item 0 > fb123456 and FacebookAppID = 123456, keys.

I am attempting to authenticate using the following code;

[FBSession openActiveSessionWithReadPermissions:permissions
                               allowLoginUI:YES
                          completionHandler:
 ^(FBSession *session,
   FBSessionState state, NSError *error) {
     [self sessionStateChanged:session state:state error:error];
 }];

Permissions is set to nil.

I also have the following set in my app delegate

- (void)applicationDidBecomeActive:(UIApplication *)application
{
[FBSession.activeSession handleDidBecomeActive];
}

- (void)applicationWillTerminate:(UIApplication *)application
{
[FBSession.activeSession close];
}

- (BOOL)application:(UIApplication *)application
        openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication
     annotation:(id)annotation {
return [FBSession.activeSession handleOpenURL:url];
}

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
return [FBSession.activeSession handleOpenURL:url];
}

One thing I have noted is that the error message hits my screen near instantly after I release the button, I put the phone into airplane mode and the speed was the same, I am thinking that the command is not even leaving the phone and going to the facebook server to begin with.. I definitely have network connection as I access a google api moments before the facebook call.

Edit:

If I use the deprecated method below

[FBSession openActiveSessionWithPermissions:nil allowLoginUI:YES completionHandler:
 ^(FBSession *session,
   FBSessionState state, NSError *error) {
     [self sessionStateChanged:session state:state error:error];
 }];

I am able to authenticate with facebook.

The session returned is

<FBSession: 0x20038450, state: FBSessionStateOpen, loginHandler: 0x2006ba90, appID: 3895930xxxxxxxx, urlSchemeSuffix: , tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0x1ed4ce30>, expirationDate: 2013-04-08 16:25:19 +0000, refreshDate: 2013-02-07 16:25:19 +0000, attemptedRefreshDate: 0001-12-30 00:00:00 +0000, permissions:(
)>

compared with this session from the failed attempt with the updated 3.1.1 methods

<FBSession: 0x1e8970b0, state: FBSessionStateClosedLoginFailed, loginHandler: 0x0, appID: 3895930xxxxxxxx, urlSchemeSuffix: , tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0x1d5853b0>, expirationDate: (null), refreshDate: (null), attemptedRefreshDate: 0001-12-30 00:00:00 +0000, permissions:(
)>

I’m assuming the missing loginHandler object gets created upon successful login.

While this allows me to continue developing the rest of my app with my logged in token, this is not acceptable for me to send my app live. Does anyone know why this is happening/what might be causing this?

  • 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-06-18T14:31:41+00:00Added an answer on June 18, 2026 at 2:31 pm

    I have got the same error on 2 instances.

    1. When the switch is not turned on in your iPhone under Settings -> Facebook -> YourAppName in order to allow your app to use the facebook account. In this case I am displaying an alert asking the user to turn the switch on for the app.

    2. When the bundle identifier of your app does not match the bundle identifier that you specified on Facebook App Settings page for your app.

    Since the error occurs for you even without internet connection I think it should be case 1.

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

Sidebar

Related Questions

This is going to be a really dumb question, I just know it, but
I'm really sorry. This must seem like an incredibly stupid question, but unless I
This might seem like a noddy question, but I was looking at this because
I know this is going to sound like a nit-picky question that isn't very
Alright, I know this is a simple question, but I can't seem to get
This might seem like a pretty detailed question about Easymock, but I'm having a
Ok I know this is going to sound weird but it is what the
i know this is a stupid question but i d'ont know how to do
This might seem like a very simple solution to some people but I have
I know this topic is much discussed but I can't seem to find any

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.