title: ACAccountStore Error 6 (ACErrorAccountNotFound) and 8
body: <p>I'm attempting to get an account from ACAccountStore using the following code:</p>
  <pre><code>- (void) facebookLoginOnSuccess: (void (^)(void)) successBlock onError:(void(^)(NSError *error))errorBlock{
  
      self.facebookPermissions = @[
          @&quot;offline_access&quot;,
          @&quot;publish_stream&quot;,
          @&quot;user_birthday&quot;,
          @&quot;user_location&quot;,
          @&quot;email&quot;
      ];
      
          
      NSDictionary *options = @{
          @&quot;ACFacebookAppIDKey&quot;: [[NSBundle mainBundle] objectForInfoDictionaryKey:@&quot;FacebookAppID&quot;],
          @&quot;ACFacebookAppVersionKey&quot;: @&quot;1.0&quot;,
          @&quot;ACFacebookPermissionsKey&quot;: self.facebookPermissions,
          @&quot;ACFacebookPermissionGroupKey&quot;: @&quot;write&quot;
      };
      
      [self accountLoginFor:ACAccountTypeIdentifierFacebook withOptions:options OnSuccess:successBlock onError:errorBlock];
  
  }
  
  - (void) accountLoginFor: (NSString *) accountTypeID withOptions: (NSDictionary *) options OnSuccess: (void (^)(void)) successBlock onError:(void(^)(NSError *error))errorBlock{
  
      ACAccountStore *accountStore = [[ACAccountStore alloc] init];
      ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:accountTypeID];
      
      [accountStore requestAccessToAccountsWithType:accountType
                                            options:options
                                         completion:^(BOOL granted, NSError *error){
          if (granted){
              NSArray *accountsArray = [accountStore accountsWithAccountType:accountType];
              NSLog(@&quot;%@&quot;,accountsArray);
          }
          else {
              NSLog(@&quot;Error accessing account: %@&quot;, [error localizedDescription]);
          }
      }];
      
  }
  </code></pre>
  <p>But I'm getting this error:</p>
  <pre><code>Error Domain=com.apple.accounts Code=6 &quot;The operation couldn't be completed. (com.apple.accounts error 6.)&quot;
  </code></pre>
  <p>And I can't find anything related, just this <a href="https://stackoverflow.com/questions/11437250/acaccountstore-error-5">question</a>. Any ideas what could be wrong?</p>
  <p><strong>Update</strong></p>
  <p>I found this on the Apple Developer Docs.</p>
  <blockquote>
  <p><strong>Accounts Framework</strong></p>
  <p>When requesting access to Facebook accounts, the only key required in your options dictionary is ACFacebookAppIdKey. <strong>ACFacebookPermissionGroupKey and ACFacebookAppVersionKey are now obsolete.</strong></p>
  <p>If you request a write permission under ACFacebookPermissionsKey, <strong>such as publish_stream</strong>, you must provide a value for ACFacebookAudienceKey, which can be one of <strong>ACFacebookAudienceEveryone</strong>, <strong>ACFacebookAudienceFriends</strong>, or <strong>ACFacebookAudienceOnlyMe</strong>.</p>
  </blockquote>
  <p>So I changed my options to:</p>
  <pre><code>    NSDictionary *options = @{
          @&quot;ACFacebookAppIDKey&quot;: [[NSBundle mainBundle] objectForInfoDictionaryKey:@&quot;FacebookAppID&quot;],
          @&quot;ACFacebookPermissionsKey&quot;: self.facebookPermissions,
          @&quot;ACFacebookAudienceKey&quot;: ACFacebookAudienceFriends
      };
  </code></pre>
  <p>But I'm getting the same error.</p>