Trying to \"follow\" someone on Twitter using new iOS 5 API, getting 406 return error. Why?
Is my code correct? Need to find out why this isn\'t working....
you can use this code
- (BOOL)openTwitterClientForUserName:(NSString*)userName {
NSArray *urls = [NSArray arrayWithObjects:
@"twitter://user?screen_name={username}", // Twitter
@"tweetbot:///user_profile/{username}", // TweetBot
@"echofon:///user_timeline?{username}", // Echofon
@"twit:///user?screen_name={username}", // Twittelator Pro
@"x-seesmic://twitter_profile?twitter_screen_name={username}", // Seesmic
@"x-birdfeed://user?screen_name={username}", // Birdfeed
@"tweetings:///user?screen_name={username}", // Tweetings
@"simplytweet:?link=http://twitter.com/{username}", // SimplyTweet
@"icebird://user?screen_name={username}", // IceBird
@"fluttr://user/{username}", // Fluttr
/** uncomment if you don't have a special handling for no registered twitter clients */
//@"http://twitter.com/{username}", // Web fallback,
nil];
UIApplication *application = [UIApplication sharedApplication];
for (NSString *urlString in urls) {
NSString *candidate = [urlString stringByReplacingOccurrencesOfString:@"{username}" withString:userName];
NSURL *url = [NSURL URLWithString:candidate];
if ([application canOpenURL:url]) {
[application openURL:url];
return YES;
}
}
return NO;
}
https://gist.github.com/ChrisRicca/9144169