Can anyone help me get a user stream in iOS?


#1

I am following this: https://dev.twitter.com/docs/auth/application-only-auth

I have my access_token. Now when I try to get the timeline - I get an error.
In the code below, accessTokenHeaderToPost = “Bearer Base64Encoded(access_token from oAuth request)”

twitURL = @“https://api.twitter.com/1.1/statuses/user_timeline.json?count=30&screen_name=skillsusari”;
request = [[NSMutableURLRequest alloc] init];
[request setURL:[NSURL URLWithString: twitURL]];
[request setHTTPMethod:@“GET”];
[request setValue:accessTokenHeaderToPost forHTTPHeaderField:@“Authorization”];
responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&err];
responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];

NSLog (@"RESP: %@", err);

RESP: Error Domain=NSURLErrorDomain Code=-1012 “The operation couldn’t be completed. (NSURLErrorDomain error -1012.)” UserInfo=0x8d6d040 {NSErrorFailingURLKey=https://api.twitter.com/1.1/statuses/user_timeline.json?count=30&screen_name=skillsusari, NSErrorFailingURLStringKey=https://api.twitter.com/1.1/statuses/user_timeline.json?count=30&screen_name=skillsusari, NSUnderlyingError=0x8d6ccf0 “The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1012.)”}