IOS7-[ACAccountStore requestAccessToAccountsWithType-“错误代码8”



我已经找到了其他有这个错误的主题,但大家都知道,我的NSDictionary还可以——在其他答案中,问题是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);
     }
   }];

提到的类似主题:

得到"错误代码8";调用[ACAccountStore requestAccessToAccountsWithType]时-iOS Facebook

ACAccountStore错误6(ACErrorAccountNotFound(和8

花了很长时间,我发现了问题:

FACEBOOK_APP_ID应为NSString

在我宣布它为长之前

static long long *const FACEBOOK_APP_ID = @"249292141827474";

相关内容

最新更新