私はこのコードを使用しています:
_accountStore = [ACAccountStore new];
ACAccountType *facebookTypeAccount =
[_accountStore accountTypeWithAccountTypeIdentifier:
ACAccountTypeIdentifierFacebook];
NSArray *accounts =
[_accountStore accountsWithAccountType:
facebookTypeAccount];
_facebookAccount = [accounts lastObject];
[_accountStore requestAccessToAccountsWithType:facebookTypeAccount
options:@{ACFacebookAppIdKey:myKey, ACFacebookPermissionsKey:@[@""]}
completion:^(BOOL granted, NSError *error) {
if(granted)
{
NSArray *accounts = [_accountStore accountsWithAccountType:facebookTypeAccount];
_facebookAccount = [accounts lastObject];
NSLog(@"Success");
[self parseUserDataWithCompletion:completion];
}
else
{
NSLog(@"Error: %@", error);
[self parseUserDataWithCompletion:completion];
}
}];
デバイス上で問題なく動作します。しかし、シミュレーターで実行するとエラーが発生します。
Error Domain=com.apple.accounts Code=7 "The operation couldn’t be completed. (com.apple.accounts error 7.)"
更新: デバイスでも動作していません。
以前は機能していました。でも今はもう…どうしたの?fbは何かを変えましたか?