requestAccessToAccountsWithType return error code 7

1.1k Views Asked by At

I'm using [ACAccountStore requestAccessToAccountsWithType] to get Facebook users info for users had logged in iOs Facebook settings. It still work fine until last week, now it always return error code 7.

Error Domain=com.apple.accounts Code=7 "The Facebook server could not fulfill this access request: remote_app_id does not match stored id  (404)" UserInfo=0x7fef59d8a760 {NSLocalizedDescription=The Facebook server could not fulfill this access request: remote_app_id does not match stored id  (404)}

I do not know why this happen, and we not changing anything in our settings in developers.facebook.com.

This is my code line.

NSDictionary *options = @{
                          ACFacebookAppIdKey : [[NSBundle mainBundle] objectForInfoDictionaryKey:@"FacebookAppID"],
                          ACFacebookPermissionsKey : @[@"email"],
                          ACFacebookAudienceKey: ACFacebookAudienceFriends
                          };
ACAccountType *FBaccountType= [self.accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
[self.accountStore requestAccessToAccountsWithType:FBaccountType options:options completion:
 ^(BOOL granted, NSError *error) {
     if (granted) {
     } else {
           // it always return not granted.
         }
     }
 }];

I don't know why it is happening now.

I have check something from this iOS 6 Facebook posting procedure ends up with "remote_app_id does not match stored id" and this Getting error ACErrorPermissionDenied (error code 7) for Facebook when using Social Framework but not found any luck.

1

There are 1 best solutions below

0
On

The issue is either of the follows:

  1. there is mismatch between the app_id entered in your xcode project and the app_id you have in developers.facebook.com. Make sure you have setup the plist file properly as pointed out in the Facebook documentation. https://developers.facebook.com/docs/ios/getting-started/#configure

    • Create a key called FacebookAppID with a string value, and add the app ID there.
    • Create a key called FacebookDisplayName with a string value, and add the Display Name you configured in the App Dashboard.
    • Create an array key called URL types with a single array sub-item called URL Schemes. Give this a single item with your app ID prefixed with fb.
  2. If your app_id matches properly, make sure to enter the app store ID in your settings at developers.facebook.com.