如何在我的iPhone应用程序中添加twitter关注按钮? [英] How to add twitter follow button in my iPhone app?

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

问题描述

开发iPhone应用程序。从我的应用程序用户可以关注我的推特账号。我想在我的应用中添加关注twitter按钮。当用户按下按钮使用户关注我的推特账号。在我没有使用任何 twitter api和twitter功能之前,我正在努力做到这一点。你能帮助我从应用程序本身关注另一个Twitter用户帐户吗?在此先感谢。

Am developing an iPhone app. From my app user can to follow my twitter account. I want to add the Follow twitter button in my app. When the user press the button make the user to follow my twitter account. Before i didn't used any twitter api and twitter functionality so am struggling to make this. Can you please help me to follow another twitter user account from the app itself? Thanks in advance.

推荐答案

无需插入另一个Twitter应用程序或其他任何内容,您可以打开一个URL来完成这项工作。

Without plugging into another twitter app or anything you could probably open a URL to do the job.

 - (IBAction)followMeOnTwitter:(id)sender {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://twitter.com/intent/user?screen_name=<twitter_screen_name>"]];
 }

只需用您的Twitter帐户名替换该URL的结尾,它应该是打开以在浏览器中关注该帐户。请务必将按钮添加到followMeOnTwitter中,方法是将其包含在视图的.h文件中。

Just replace the end of that URL with your twitter account name, and it should open to follow that account in the browser. Be sure to connect your button to "followMeOnTwitter" by including it in your view's .h file.

这篇关于如何在我的iPhone应用程序中添加twitter关注按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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