gpt4 book ai didi

ios - 始终授予 Twitter SSO

转载 作者:行者123 更新时间:2023-11-29 03:02:27 24 4
gpt4 key购买 nike

- (void)authTwitter {

ACAccountStore *accountStore = [[ACAccountStore alloc] init];
ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];

[accountStore requestAccessToAccountsWithType:accountType
options:nil
completion:^(BOOL granted, NSError *error){
if (granted) {
NSArray *accounts = [accountStore accountsWithAccountType:accountType];
// always there, but accounts array is empty
} else {

}
}];

我期待看到来自 iOS 的一些提示,但总是同意。我的 iPhone 上没有设置帐户。

这是否意味着我编程的时间太多了,应该出去玩?或者我只是错过了什么?

iOS 7,设备和模拟器都有相同的行为。

最佳答案

你已经在那里了。完成 block 应该是:

   {
bool actuallyGranted = granted;

NSArray *accounts = [accountStore accountsWithAccountType:accountType];
if (!accounts || ([accounts count] == 0))
actuallyGranted = false;

if (actuallyGranted)
{

}

else
{

}
}

FB 的类似调用不需要这个 - “granted”的值将是正确的。我假设 Twitter 所需的特殊情况是 iOS 错误。

关于ios - 始终授予 Twitter SSO,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23160147/

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