2010-01-06 89 views
1

我有一个应用程序,我希望能够使用自定义URL方案。我希望用户能够使用自定义URL协议打开Tweetie,但是我需要使用currentItem.link填充动态网站链接的推文。如何使用iPhone自定义URL方案

我发现这个代码,启动特威特并填充静态信息的消息:

NSString *shortened_url = @"http://your.url.com"; 
NSString *stringURL = [NSString stringWithFormat:@"tweetie://%@", shortened_url]; 
NSURL *url = [NSURL URLWithString:stringURL]; 
[[UIApplication sharedApplication] openURL:url]; 

因此,使用上面的代码,我怎么会填充currentItem.link信息的消息?

谢谢。

回答

0

它完全取决于接收端的应用。你必须找出他们的协议是如何工作的,然后你可以按照它的设计使用他们的协议。

向tweetie://协议的末尾添加http://协议URL不是正确的方法,并且会搜索Tweetie URL协议如何工作的建议。

+0

其实根据一个站点,你可以在tweetie协议之后有http://。但我一直在努力让currentItem.link进入Tweetie Custom URL。 – Graeme 2010-01-06 09:25:11

0

Tweetie protocol已记载,但尚不清楚,自客户转换为官方Twitter之后,这仍然适用多少。我相信你想要的格式为:

NSString *stringURL = [NSString stringWithFormat:@"tweetie://post?message=%@", shortened_url]; 

我已经试过这得到account选择参数工作。基本方法有效,但帐户选择不适合我。