一旦我被授予访问Twitter帐户的权限,我需要帮助获取推特个人资料照片。下面的代码获取了配置文件句柄(@twitter)。有没有办法直接从iOS5的Twitter中提取这些信息?
这就是我对句柄有用的东西:
-(void)getTwitterName
{
ACAccountStore *accountStore = [[ACAccountStore alloc] init];
ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
[accountStore requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error)
{
if(granted) {
NSArray *accountsArray = [accountStore accountsWithAccountType:accountType];
}
}
答案 0 :(得分:2)
您可以通过以下网址获取:http://api.twitter.com/1/users/profile_image/:screen_name.format
例如,我的个人资料图片为http://api.twitter.com/1/users/profile_image/don_kim
您可以在其上阅读更多内容here。