0

我正在使用 [ACAccountStore requestAccessToAccountsWithType] 来获取登录 iOs Facebook 设置的用户的 Facebook 用户信息。直到上周它仍然可以正常工作,现在它总是返回错误代码 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)}

我不知道为什么会发生这种情况,而且我们没有更改 developer.facebook.com 中的设置。

这是我的代码行。

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.
         }
     }
 }];

我不知道为什么现在会发生。

我已经从这个iOS 6 Facebook 发布过程中检查了一些内容,结果是“remote_app_id 与存储的 id 不匹配”,并且在使用 Social Framework 时为 Facebook 获取错误 ACErrorPermissionDenied(错误代码 7),但没有找到任何运气。

4

1 回答 1

0

问题是以下之一:

  1. 在您的 xcode 项目中输入的 app_id 与您在 developers.facebook.com 中的 app_id 不匹配。确保您已按照 Facebook 文档中的说明正确设置 plist 文件。https://developers.facebook.com/docs/ios/getting-started/#configure

    • 使用字符串值创建一个名为 FacebookAppID 的键,并在其中添加应用程序 ID。
    • 使用字符串值创建一个名为 FacebookDisplayName 的键,并添加您在 App Dashboard 中配置的显示名称。
    • 使用称为 URL Schemes 的单个数组子项创建一个称为 URL 类型的数组键。给这一个项目,你的应用 ID 以 fb 为前缀。
  2. 如果您的 app_id 正确匹配,请确保在 developer.facebook.com 的设置中输入应用商店 ID。

于 2015-06-16T01:01:07.657 回答