I want to reply to twitter status with status id. but i get http response 403. Here my code. I can sent first tweet. I get it's id. But when i want sent reply to first tweet with it's id i get http response 403. What is my wrong.
- (IBAction)btnSendToucUpInside:(id)sender {
__block NSDecimalNumber *tid;
__block int i = 0;
while (true) {
if (i == 0 || _birlestirilsinMi) {
urlParametres = [NSDictionary dictionaryWithObjectsAndKeys: [NSString stringWithFormat:@"%@", [self.twitArray objectAtIndex:0]], @"status", nil];
}else{
urlParametres = [NSDictionary dictionaryWithObjectsAndKeys: [NSString stringWithFormat:@"%@", [self.twitArray objectAtIndex:0]], @"status",[NSString stringWithFormat:@"%@",tid], @"in_reply_to_status_id",@"true", @"include_entities", nil];
}
TWRequest *postRequest = [[TWRequest alloc] initWithURL:[NSURL URLWithString:@"https://api.twitter.com/1/statuses/update.json"] parameters:urlParametres requestMethod:TWRequestMethodPOST];
[postRequest setAccount:[twitAccountArray objectAtIndex:0]];
[postRequest performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error)
{
if (responseData) {
i++;
NSDictionary *TWData = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingMutableLeaves error:&error];
tid = TWData[@"id"];
NSLog(@"%@",tid);
//show status after done
NSString *output = [NSString stringWithFormat:@"HTTP response status: %i", [urlResponse statusCode]];
NSLog(@"Twiter post status : %@", output);
}
}];
if (i == _twitArray.count -1) {
break;
}
}
}