I need help getting the twitter profile pic once I’ve been granted access to the Twitter account. The code below gets me the profile handle (@twitter). Is there a way to pull this info directly from Twitter in iOS5?
Here’s what I have that works for the handle:
-(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];
}
}
You can get it from this URL: http://api.twitter.com/1/users/profile_image/:screen_name.format
My profile image, for example, would be http://api.twitter.com/1/users/profile_image/don_kim
You can read more on it here.