我正在使用来自 WWDC 的代码来访问用户的 facebook 帐户:
self.accountStore = [[ACAccountStore alloc] init];
ACAccountType *facebookAccountType = [self.accountStore
accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
[self.accountStore requestAccessToAccountsWithType:facebookAccountType
withCompletionHandler:^(BOOL granted, NSError *e) {
if (granted) {
NSArray *accounts = [self.accountStore
accountsWithAccountType:facebookAccountType];
self.facebookAccount = [accounts lastObject];
} else {
// Fail gracefully...
}
}];
但它给了我错误requestAccessToAccountsWithType:withCompletionHandler:
。
如何访问用户的 Facebook 帐户?