虽然,有这样一个问题Facebook 错误 (7) iOS 6 https://stackoverflow.com/questions/12498972/facebook-error-7-ios-6已经关闭了,没有任何答复!
在获取用户 Facebook 帐户的访问权限时,出现错误:error is: Error Domain=com.apple.accounts Code=7 "The Facebook server could not fulfill this access request: The proxied app is not already installed." UserInfo=0xa260270 {NSLocalizedDescription=The Facebook server could not fulfill this access request: The proxied app is not already installed.}
我正在执行这样的请求:
self.statusLabel.text = @"Waiting for authorization...";
if (self.accountStore == nil) {
self.accountStore = [[ACAccountStore alloc] init];
}
ACAccountType * facebookAccountType = [self.accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
NSDictionary * dict = @{ACFacebookAppIdKey : FB_APP_ID, ACFacebookAudienceKey : ACFacebookAudienceEveryone};
[self.accountStore requestAccessToAccountsWithType:facebookAccountType options:dict completion:^(BOOL granted, NSError *error) {
__block NSString * statusText = nil;
if (granted) {
statusText = @"Logged in";
NSArray * accounts = [self.accountStore accountsWithAccountType:facebookAccountType];
self.facebookAccount = [accounts lastObject];
NSLog(@"account is: %@", self.facebookAccount);
self.statusLabel.text = statusText;
[self postToFeed];
}
else {
self.statusLabel.text = @"Login failed";
NSLog(@"error is: %@", error);
}
}];
这个错误是什么意思?
I've solved this problem!
It was because I do not pass permissions array!
Though the ACAccountStore
class states that this parameter is optional, it is not!
更重要的是,应用程序可以启动并请求基本权限(正如它所暗示的那样)!
因此,您必须始终传递权限数组。
以下是帐户存储返回的错误代码的说明:
typedef enum ACErrorCode {
ACErrorUnknown = 1,
ACErrorAccountMissingRequiredProperty,
ACErrorAccountAuthenticationFailed,
ACErrorAccountTypeInvalid,
ACErrorAccountAlreadyExists,
ACErrorAccountNotFound,
ACErrorPermissionDenied,
ACErrorAccessInfoInvalid
} ACErrorCode;
(我有ACErrorPermissionDenied
here)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)