5

I tried to login using facebook followed the facebook tutorial in https://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/3.1/ to implement it but after the alert view asking me to allow my app use your data and press ok the error

The operation could not be completed . (com.facebook.sdk error 2)

note that iam in the simulatore and i entered FB my account inside setting and it is logged correctly.

debugging the issue it and the result of the error is as following :

(NSError *) $1 = 0x0ac77290 Error Domain=com.facebook.sdk Code=2 "The operation couldn’t be completed. (com.facebook.sdk error 2.)" UserInfo=0xac77450 {com.facebook.sdk:ErrorLoginFailedReason=com.facebook.sdk:ErrorLoginFailedReason, com.facebook.sdk:ErrorInnerErrorKey=Error Domain=com.apple.accounts Code=7 "The Facebook server could not fulfill this access request: no stored remote_app_id for app" UserInfo=0xaa91d40 {NSLocalizedDescription=The Facebook server could not fulfill this access request: no stored remote_app_id for app}}

5 Answers 5

6

You need to provide your app bundle id in app settings on developers.facebook.com

iOS 6 Facebook posting procedure ends up with "remote_app_id does not match stored id"

1
2

It worked for me after signing out of facebook from Device Setting's.

1
  • 2
    This is more of a workaround! If you are signing out of your FB from settings, then it follows a different flow (opens a browser). When user uses the app, he is not gonna sign out of his settings to make it work for your app.
    – Dev
    Jan 22, 2013 at 12:12
2

This kind of error could be come due to this reason:-

  1. Might be your bundle id is different over developers.facebook.com/aaps

  2. your are might be not giving right permission to your app.

  3. You are not enabling facebook app in your iphone facebook settings.

Please follow given below link

Facebook Registration : The operation couldn't be completed (com.facebook.sdk error 2)

I hope this would clear your all doubt.

0

In ios 6 with fb sdk 3.1.1. Please pass permissions param as "nil or email" in "[FBSessio openActiveSessionWithReadPermissions..." method. Here my code it was works great.

#define IOS_NEWER_OR_EQUAL_TO_6 ( [ [ [ UIDevice currentDevice ] systemVersion ] floatValue ] >= 6.0 )

-(void)showFBLogin
{
    [FBSession.activeSession closeAndClearTokenInformation];

    NSArray *permissions = [NSArray arrayWithObjects:@"email, publish_actions, publish_stream", nil];

#ifdef IOS_NEWER_OR_EQUAL_TO_6
    permissions = nil; or NSArray *permissions = [NSArray arrayWithObjects:@"email",nil];
#endif

    NSLog(@"\npermissions = %@", permissions);
    [FBSession openActiveSessionWithReadPermissions:permissions
                                       allowLoginUI:YES
                                  completionHandler:
     ^(FBSession *session,
       FBSessionState state, NSError *error) {
         NSLog(@"\nfb sdk error = %@", error);
         switch (state) {
             case FBSessionStateOpen:
                 [[FBRequest requestForMe] startWithCompletionHandler:
                  ^(FBRequestConnection *connection, NSDictionary<FBGraphUser> *user, NSError *error) {
                      if (!error) {
                          //success
                      } 
                  }];
                 break;
             case FBSessionStateClosed:
                 //need to handle
                 break;
             case FBSessionStateClosedLoginFailed:
                 //need to handle
                 break;
             default:
                 break;
         }
     }];
}
0

This worked for me:

Go to the settings app of your iPhone. Open your Facebook Settings Scroll down to your app and make sure your app allows facebook interaction.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.