如何从我的iPhone应用程序在Twitter应用程序中打开Twitter页面? [英] How to open twitter page in twitter app from my iphone app?

查看:388
本文介绍了如何从我的iPhone应用程序在Twitter应用程序中打开Twitter页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要使用Twitter应用程序打开的页面:

The page I want to open using twitter app:

https://twitter.com/#!/PAGE

要打开Twitter应用程序,请使用以下代码:

To open twitter app I use the following code:

NSURL *urlApp = [NSURL URLWithString: [NSString stringWithFormat:@"%@", @"twitter://https://twitter.com/#!/PAGE"]];
[[UIApplication sharedApplication] openURL:urlApp];

但是此代码似乎无法按预期工作,我只启动了Twitter应用程序,而没有要显示的页面.

But this code doesn't seem to work as expected, I got only twitter app launched without the page which i want to show.

推荐答案

您正在寻找以下网址:

twitter:///user?screen_name=PAGE

请注意,并非所有设备上都安装了Twitter.您应该检查openURL方法的结果.如果失败,请使用常规网址在Safari中打开页面.

Note that Twitter is not installed on all devices. You should check the result of openURL method. If it fails, open the page in Safari with regular url.

这篇关于如何从我的iPhone应用程序在Twitter应用程序中打开Twitter页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆