gpt4 book ai didi

objective-c - 如何访问用户的 Facebook 帐户? OSX 山狮

转载 作者:行者123 更新时间:2023-12-03 17:31:51 25 4
gpt4 key购买 nike

我正在使用 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: 上给了我错误。
enter image description here
我如何访问用户的 Facebook 帐户?

最佳答案

Facebook 支持仅在 10.8.2 中添加。您还在使用 10.8.2 吗?如果是这样,您收到的具体错误代码是什么?我们不是读心术。

<小时/>

如果您按预期读取 header ,您会看到 -requestAccessToAccountsWithType:withCompletionHandler: 在 Mac 上不存在,并且在 Mac 上已弃用iOS。您应该使用 -requestAccessToAccountsWithType:options:completion:

关于objective-c - 如何访问用户的 Facebook 帐户? OSX 山狮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13258922/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com