Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add twitter follow button in my iPhone app?

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.

like image 213
Gopinath Avatar asked Apr 30 '12 06:04

Gopinath


1 Answers

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.

like image 177
Anthony Neace Avatar answered Sep 18 '22 14:09

Anthony Neace