Launching Twitter for iOS using twitter:// url schemes

4,463 views
Skip to first unread message

Daniel

unread,
May 15, 2011, 8:16:51 AM5/15/11
to Twitter Development Talk
Hi, I can't find any documentation, or even a place to ask this
question, so sorry if this is off-topic...

I'm an iOS developer, and I'd like to attempt to open the Twitter app
on the device, (from my app) at a particular profile, or even in a
state to @mention a particular username. Currently I can do this...


BOOL didOpenOtherApp = NO;

if ([device respondsToSelector:@selector(isMultitaskingSupported)]
&& [device isMultitaskingSupported]) {
NSString *urlString = [NSString stringWithFormat:@"twitter://
%@", USER_NAME];
didOpenOtherApp = [NSApp openURL:[NSURL
URLWithString:urlString];
}

if (!didOpenOtherApp) {
NSString *urlString = [NSString stringWithFormat:@"https://
twitter.com/%@", USER_NAME];
didOpenOtherApp = [NSApp openURL:[NSURL
URLWithString:urlString];
}

And, if the user has Twitter for iPhone installed, then it'll open,
but it won't go to that profile or anything, so, it responds to twitter://
but not anything in the actual URL, that I can make out.

So, essentially, I'm just wondering if there is any documentation on
the format of the URL strings that are meaningful to Twitter on iOS
devices, and if it's even possible to do what I'm trying here? I'd
love to be able to launch the app and put it into a state ready for
posting a new tweet, maybe something like: twitter://tweet@<USER_NAME>

Thanks
Dan

Tom van der Woerdt

unread,
May 15, 2011, 12:51:04 PM5/15/11
to twitter-deve...@googlegroups.com
If I'm not mistaken, Twitter for iOS still responds to the old
tweetie:// URL schemes.

http://wiki.akosma.com/IPhone_URL_Schemes#Tweetie (found them on google)

Also, the Mac version of Twitter for iOS supports twitter:// as well - I
think I've seen URLs that opened profile but I don't remember where I
saw that.

twitter:///post?message=test definitely works on the Mac version, so
I'll assume that it works on the iOS version as well.

Tom

Tom van der Woerdt

unread,
May 15, 2011, 12:56:32 PM5/15/11
to twitter-deve...@googlegroups.com
I just found that "twitter:///user?screen_name=tvdw" works as well.

Tom

Reply all
Reply to author
Forward
0 new messages