Gopinath
Gopinath

Reputation: 5442

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.

Upvotes: 7

Views: 4307

Answers (1)

Anthony Neace
Anthony Neace

Reputation: 26023

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.

Upvotes: 9

Related Questions