title: Getting "Error Code 8" When Calling [ACAccountStore requestAccessToAccountsWithType] - iOS Facebook
body: <p>I have been searching Google and SO and cannot find what com.apple.accounts Error Code 8 means. I am attempting to use iOS 6 and the Facebook SDK.</p>
  
  <p>I run this request;</p>
  
  <pre><code>  if (!_accountStore) _accountStore = [[ACAccountStore alloc] init];
  
  ACAccountType *fbActType = [_accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
  
  
  NSDictionary *options = [[NSDictionary alloc] initWithObjectsAndKeys:
                           (NSString *)ACFacebookAppIdKey, @"###############",  
                           (NSString *)ACFacebookPermissionsKey, [NSArray arrayWithObject:@"email"],  
                           nil];
  
  
  
  [_accountStore requestAccessToAccountsWithType:fbActType options:options completion:^(BOOL granted, NSError *error) {
                                              if (granted) {
                                                  NSLog(@"Success");
                                                  NSArray *accounts = [_accountStore accountsWithAccountType:fbActType];
                                                  _facebookAccount = [accounts lastObject];                                                    
                                              } else {
                                                  NSLog(@"ERR: %@",error);
                                                  // Fail gracefully...
                                              }
          }
   ];
  </code></pre>
  
  <p>I get this error:</p>
  
  <p><code>ERR: Error Domain=com.apple.accounts Code=8 "The operation couldn’t be completed. (com.apple.accounts error 8.)"</code></p>
  
  <p>No matter what I do, <code>granted</code> never returns true. Any ideas would be very much appreciated. </p>
  
  <p>If I bypass the <code>if(granted)</code> and call this function:</p>
  
  <pre><code>- (void)me{
  
      NSLog(@"Home.m - (void)me");
  
      NSURL *meurl = [NSURL URLWithString:@"https://graph.facebook.com/me"];
  
      SLRequest *merequest = [SLRequest requestForServiceType:SLServiceTypeFacebook
                                                requestMethod:SLRequestMethodGET
                                                          URL:meurl
                                                   parameters:nil];
  
      merequest.account = _facebookAccount;
  
      [merequest performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
          NSString *meDataString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
  
          NSLog(@"%@", meDataString);
  
      }];
  </code></pre>
  
  <p>Then I see this JSON that is returned by Facebook:
  <code>{"error":{"message":"An active access token must be used to query information about the current user.","type":"OAuthException","code":2500}}}</code></p>
  
  <p><strong>Update:</strong> So, the error means "The client's access info dictionary has incorrect or missing values." but I do not know what that means.</p>