【问题标题】:IOS7 - [ACAccountStore requestAccessToAccountsWithType - “error code 8”IOS7 - [ACAccountStore requestAccessToAccountsWithType - “错误代码 8”
【发布时间】:2013-10-18 03:39:58
【问题描述】:

我已经找到了其他有此错误的主题,但是每个人都可以看到,我的 NSDictionary 还可以 - 在其他答案中,问题是选项参数。

我正在使用 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

ACAccountStore Error 6 (ACErrorAccountNotFound) and 8

【问题讨论】:

    标签: ios objective-c acaccountstore


    【解决方案1】:

    折腾了好久,发现问题:

    FACEBOOK_APP_ID 应该是一个 NSString

    在我声明它为long之前

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

    【讨论】:

      猜你喜欢
      • 2013-05-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-11
      • 1970-01-01
      • 1970-01-01
      • 2015-12-18
      • 2017-01-18
      相关资源
      最近更新 更多