Adeesh Jain
Adeesh Jain

Reputation: 645

iOS Twitter User-Timeline fetching with v1.1 API

Recently Twitter has changed API to v1.1. With this API, it is now required to first login on Twitter and only then we can fetch timeline. Is that true?

Can we fetch user timeline without user login?

Thanks

Upvotes: 2

Views: 2926

Answers (3)

Adeesh Jain
Adeesh Jain

Reputation: 645

I tried FHSTwitterEngine but I found STTwitter better: https://github.com/nst/STTwitter

Upvotes: 3

nst
nst

Reputation: 3882

You can perfectly fetch a user timeline even if the user is not logged in.

You have to use the new "App Only" mode in which only the application is authentified.

See more details in this answer.

Upvotes: 0

the1pawan
the1pawan

Reputation: 1204

look at FHSTwitterEngine you can use newly FHSTwitterEngine and if you request this method without autenticating, the users status is removed... you have to send consumer key and token along with screen_name.. In FHSTwitterEngine

//get username pass to method. In Dictionary you can get all info  
NSString *username = [[FHSTwitterEngine sharedEngine]loggedInUsername];
NSDictionary *data=[[FHSTwitterEngine sharedEngine]getUserProfile:username];



// method to get all user info
-(id)getUserProfile:(NSString *)username
{

  if (username.length == 0) {
   return getBadRequestError();
  }

 NSURL *baseURL = [NSURL URLWithString:url_users_show];
 OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];
 OARequestParameter *usernameP = [OARequestParameter requestParameterWithName:@"screen_name" value:username];

 NSArray *params = [NSArray arrayWithObjects:usernameP, nil];

 id userShowReturn = [self sendGETRequest:request withParameters:params];
 return userShowReturn;
}

Upvotes: 1

Related Questions