2

I have added facebook sdk for accessing the user account. But when user is already login in facebook via iOS 6 facebook then in my app on the very first page it must shows the alert that app is asking for profile permissions. For it I have added following code in app delegate

[FBSession openActiveSessionWithAllowLoginUI:true];

NSArray *permissions = [NSArray arrayWithObjects:
                        @"friends_about_me",nil];
[FBSession openActiveSessionWithReadPermissions:permissions allowLoginUI:true  
 completionHandler:^(FBSession *session, FBSessionState status, NSError *error) {
    if (error) {
        NSLog(@"Failure");
    }
}];

return YES;

}

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

I am getting the alert properly. enter image description here

But when I click on OK button it gives me following error

FBSDKLog: System authorization failed:'The Facebook server could not fulfill this access request: remote_app_id does not match stored id '. This may be caused by a mismatch between the bundle identifier and your app configuration on the server at developers.facebook.com/apps.

But in my fb developer account , everything is fine. Please help me in resolving this issue.

Thanks!

Sudha Tiwari
  • 2,499
  • 26
  • 50
  • I don't know the exact problem but please take a look on these discussion may it helps you: http://stackoverflow.com/questions/12838118/facebook-authorization-fails-on-ios6-when-switching-fb-account-on-device & http://stackoverflow.com/questions/12601191/facebook-sdk-3-1-error-validating-access-token & https://developers.facebook.com/docs/howtos/login-with-facebook-using-ios-sdk/#protip3 – Vishal Apr 24 '13 at 03:29

4 Answers4

9

Are you sure you have the same bundle ID set in your Facebook app settings? A good way to validate is to use this code to print the bundle ID to the console and compare it with your app settings on Facebook:

NSLog(@"Bundle ID: %@",[[NSBundle mainBundle] bundleIdentifier]);
Amir Naor
  • 2,236
  • 20
  • 27
4

Dear Sudha may be your bundle id is not confirmed yet from all server of facebook. You have to wait for it.

Minkle Garg
  • 1,397
  • 3
  • 13
  • 27
3

Beware that your bundle ID is case sensitive!

Peter O.
  • 55
  • 8
0

I Faced the same issue when i run my project in 3.5 inch simulator it shows the same error. It works fine in 4 inch simulator. I fixed this issue by going to my 3.5 inch simulator settings then i logged out from my Facebook account. then i re run the project it worked.

Peer Mohamed Thabib
  • 636
  • 2
  • 9
  • 29