Search code examples
iosobjective-ctwitteroauth

Twitter integration in iPhone using OAuth


In my iPhone application I have one option for import twitter followers in my friend list. (friend list which is display in my application)as per my knowledge I need to follow the steps below:

  1. Twitter OAuth integration in my application and get access_token.
  2. find API for get followers list from twitter developer site.

If anyone have good approach than kindly guide me.


Solution

  • You can use (on iOS 5 and above) the Accounts + Twitter frameworks to make your access to Twitter a lot easier. This way, you don't need to manually deal with the OAuth protocol. You can also take advantage of the fact that a user may have their Twitter account already set up at the OS level, meaning you don't need them to log in again. See links below on how to use these.

    Your second question regarding followers list, you can get a list of followers using the following API Resource: https://dev.twitter.com/docs/api/1.1/get/followers/list

    Using that API along with the Twitter framework should get the results you are after/

    Sources

    Accounts framework reference: http://developer.apple.com/library/ios/#documentation/Accounts/Reference/AccountsFrameworkRef/_index.html#//apple_ref/doc/uid/TP40011024

    Twitter framework reference: http://developer.apple.com/library/ios/#documentation/Twitter/Reference/TwitterFrameworkReference/_index.html#//apple_ref/doc/uid/TP40011014

    Sample code on how to use these frameworks: http://developer.apple.com/library/ios/#samplecode/Tweeting/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011191