I want to post a photo to twitter from my iOS app. I can post a tweet without media but when i am trying to attach media it throws an error.
I am following twitter docu
Completing the Saani's answer
// Post tweet With media_id
mediaID = [json objectForKey:@"media_id_string"];
client = [[Twitter sharedInstance] APIClient];
message = @{@"status": title, @"wrap_links": @"true", @"media_ids": mediaID};
NSURLRequest *request = [client URLRequestWithMethod:@"POST" URL:@"https://api.twitter.com/1.1/statuses/update.json" parameters:message error:&error];
[client sendTwitterRequest:request completion:^(NSURLResponse * _Nullable response, NSData * _Nullable data, NSError * _Nullable connectionError) {
if (connectionError) {
NSLog(@"error %@",[connectionError localizedDescription]);
} else {
NSError *jsonError;
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonError];
NSLog(@"json Finish! %@",json);
}
}];