How to add twitter follow button in my iPhone app?

自古美人都是妖i 提交于 2020-01-01 03:09:15

问题


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.


回答1:


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>"]];
 }

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.



来源:https://stackoverflow.com/questions/10379201/how-to-add-twitter-follow-button-in-my-iphone-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!