【发布时间】:2012-11-07 05:09:50
【问题描述】:
我正在使用来自 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 帐户?
【问题讨论】:
标签: objective-c facebook macos cocoa acaccount