大佬教程收集整理的这篇文章主要介绍了在iOS中使用Twitter Framework处理Twitter,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
ACAccountStore *t_account = [[ACAccountStore alloc] init]; ACAccountType *accountType = [account accountTypeWithAccountTypEIDentifier:ACAccountTypEIDentifierTwitter]; [account requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted,NSError *error) { if (granted == YES) { } }
但问题是我不需要一个完整的帐户,如果他在Twitter帐户上配置了任何帐户,我只想要推特名称.那么,有没有办法从框架(而不是完整的帐户)获得Twitter句柄而不询问任何用户权限?
ACAccountStore *accountStore = [[ACAccountStore alloc] init]; // Create an account type that ensures Twitter accounts are retrieved. ACAccountType *accountType = [accountStore accountTypeWithAccountTypEIDentifier:ACAccountTypEIDentifierTwitter]; NSArray *accountsArray = [accountStore accountsWithAccountType:accountType]; for (ACAccount *account in accountsArray ) { NSLog(@"Account name: %@",account.userName); } NSLog(@"Accounts array: %d",accountsArray.count);
ACAccountStore *accountStore = [[ACAccountStore alloc] init]; // Create an account type that ensures Twitter accounts are retrieved. ACAccountType *accountType = [accountStore accountTypeWithAccountTypEIDentifier:ACAccountTypEIDentifierTwitter]; [accountStore requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted,NSError *error) { if(granted) { NSArray *accountsArray = [accountStore accountsWithAccountType:accountType]; for (ACAccount *account in accountsArray ) { NSLog(@"Account name: %@",account.userName); } NSLog(@"Accounts array: %d",accountsArray.count); } }];
以上是大佬教程为你收集整理的在iOS中使用Twitter Framework处理Twitter全部内容,希望文章能够帮你解决在iOS中使用Twitter Framework处理Twitter所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。