Skip to content

Instantly share code, notes, and snippets.

@ChrisRicca
Forked from vhbit/twitter.m
Created February 21, 2014 21:46
Show Gist options
  • Save ChrisRicca/9144169 to your computer and use it in GitHub Desktop.
Save ChrisRicca/9144169 to your computer and use it in GitHub Desktop.
- (BOOL)openTwitterClientForUserName:(NSString*)userName {
NSArray *urls = [NSArray arrayWithObjects:
@"twitter:@{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 *candidate in urls) {
candidate = [candidate stringByReplacingOccurrencesOfString:@"{username}" withString:userName];
NSURL *url = [NSURL URLWithString:candidate];
if ([application canOpenURL:url]) {
[application openURL:url];
return YES;
}
}
return NO;
}
@syrakozz
Copy link

syrakozz commented Feb 2, 2015

you miss this
twitter://user?screen_name=versluis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment