7

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.

The iOSDev
  • 5,237
  • 7
  • 41
  • 78
Gopinath
  • 5,392
  • 21
  • 64
  • 97

1 Answers1

9

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.

Anthony Neace
  • 25,013
  • 7
  • 114
  • 129
  • 2
    Hello Mr.Hyper Anthony. Thanks for your spot response. I have entered ur URL in the browser. My twitter page is opening with follow button. But, i don't want to open the twitter page in safari from my app. I want the user follow my twitter account from the app without navigate to any other places. Can you please help me. Thanks. – Gopinath Apr 30 '12 at 06:17
  • 1
    Ah, well in that case... check out this question: http://stackoverflow.com/questions/8085785/trying-to-follow-someone-on-twitter-using-new-ios-5-api-getting-406-return-er – Anthony Neace Apr 30 '12 at 06:36
  • Hello Mr.Hayper Anthony. Thanks a lot for your reply. I have visited that question and realized how i missed to search in this criteria? Thanks once again. I will try it and let know you. Now i accept your answer and put up mark to u... Thanks. – Gopinath Apr 30 '12 at 07:05