我已经找到了这个错误的其他主题,但是每个人都可以看到,我的NSDictionary是OK的-在其他答案中,问题是options参数。
我正在使用XCode5,并在IOS7上运行
ACAccountStore *accountStore = [[ACAccountStore alloc] init];
ACAccountType *facebookAccountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
NSDictionary *options = @{ACFacebookAppIdKey : @(FACEBOOK_APP_ID),
ACFacebookPermissionsKey : @[@"email", @"publish_stream"],
ACFacebookAudienceKey : ACFacebookAudienceFriends};
[accountStore requestAccessToAccountsWithType:facebookAccountType options:options completion:^(BOOL granted, NSError *error)
{
if (granted)
{
NSArray *accounts = [accountStore accountsWithAccountType:facebookAccountType];
if([accounts count]>0)
callbackSuccess();
} else {
callbackFailure(error);
}
}];提到的类似主题:
Getting "Error Code 8" When Calling [ACAccountStore requestAccessToAccountsWithType] - iOS Facebook
发布于 2013-10-18 11:59:11
在花了很长时间之后,我发现了问题:
FACEBOOK_APP_ID应为NSString
在我声明它为long long之前
static long long *const FACEBOOK_APP_ID = @"249292141827474";https://stackoverflow.com/questions/19441186
复制相似问题