Twitter in an iOS app - how can I get a list feed only from my account [without the need to add an app user on twitter]

I am making an iOS application which should show tweets in the feed of the list I created. The problem is that [I don’t want to use the Twitter account for end users at all], I just want to show this list in the application by pulling its data through the Twitter API.

Unfortunately, for me, the Twitter API after version 1.1 requires authentication to do something with it.

https://dev.twitter.com/docs/api/1.1/get/lists/statuses#example-request

All the cases I've seen use a user login in iOS to enter channels, which works, but here is my problem:

Can I authenticate these requests for a list feed, without the end user who uses the application, which must be signed into my own iOS Twitter account. that is, requests are authenticated using one specific [mine] twitter account?

or if there is a way to get raw feed data without using the twitter API [I need raw data to fit into a UITableView in my application - I don't want to use UIWebView].

this would make the feed available to end users without a twitter account [anyway, the list channel is public, so I don’t know why it needs authentication in the first place].

Thank you very much!

+6
source share
2 answers

Update: they seem to be the problem of limiting the number of requests in this approach, use the following answer fooobar.com/questions/937989 / ...

He uses STTwitter ,

It contains a request limit check method.

- (void)getRateLimitsForResources:(NSArray *)resources // eg. statuses,friends,trends,help successBlock:(void(^)(NSDictionary *rateLimits))successBlock errorBlock:(void(^)(NSError *error))errorBlock { 

use this method to check the current api limit, since now the api limit is 15 minutes, for more details visit Twitter 1.1 API Limit

===================================

If you have not found a solution, you can try this approach.

  1. Register your application on twitter https://dev.twitter.com/apps

  2. At the bottom of the application information page "click the" Create my access token "button, it will create an access token and a secret key

  3. Download FHSTwitterEngine https://github.com/fhsjaagshs/FHSTwitterEngine

Use the following code to set the twitter engine access token:

 self.engine = [[FHSTwitterEngine alloc]initWithConsumerKey:@"yourAppConsKey" andSecret:@"yourAppsecret"]; OAToken *token = [[OAToken alloc] init]; token.key = @"setaccessToken"; token.secret = @"setAccessTokenSecret"; [self.engine setAccessToken:token]; 

You can try this method to get tweets.

 [self.engine getTimelineForUser:username isID:NO count:1]; 

Also make sure SystemConfiguration.framework is added to your project

+14
source

Using the STTwitter library, you can receive twitter feeds without logging in, there are methods for obtaining all timelines or for specific lists using screenName, first you set the consumer keys and secrets:

 self.twitter = [STTwitterAPI twitterAPIAppOnlyWithConsumerKey:kTwitterConsumerKey consumerSecret:kTwitterSecretKey]; 

and then get the timeline from the list using the screen name:

 [_twitter verifyCredentialsWithSuccessBlock:^(NSString *bearerToken) { // NSLog(@"Access granted with %@", bearerToken); // load user tweets according to list [_twitter getListsStatusesForSlug:kSlug screenName:kScreenName ownerID:nil sinceID:nil maxID:nil count:nil includeEntities:0 includeRetweets:0 successBlock:^(NSArray *statuses) { //your code for getting feeds from array statuses } errorBlock:^(NSError *error) { NSLog(@"-- error: %@", error); }]; } errorBlock:^(NSError *error) { NSLog(@"-- error %@", error); }]; 

this worked for me, and if you want to get a list of followers, use the FHSTwitter mechanism and the status check method:

 [[FHSTwitterEngine sharedEngine] lookupFriendshipStatusForUsers:users areIDs:NO]; 
+1
source

All Articles