iOS Twitter User-Timeline fetching with v1.1 API

≯℡__Kan透↙ 提交于 2020-01-01 07:05:09

问题


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


回答1:


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




回答2:


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;
}



回答3:


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.



来源:https://stackoverflow.com/questions/17140832/ios-twitter-user-timeline-fetching-with-v1-1-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!