Ios 使用STTwitter将多张照片上传到Twitter

Ios 使用STTwitter将多张照片上传到Twitter,ios,twitter,sttwitter,twitter-rest-api,Ios,Twitter,Sttwitter,Twitter Rest Api,我知道你可以在一条tweet上发布多达四张图片,所以我想知道这是否可能,可能是使用STTwitter 我知道你可以在STTwitter上使用这种方法上传一张图片,但据我所知,这种方法不支持多张图片: - (NSObject<STTwitterRequestProtocol> *)postMediaUpload:(NSURL *)mediaURL uploadProgressBlock:(void(^)(NSInt

我知道你可以在一条tweet上发布多达四张图片,所以我想知道这是否可能,可能是使用STTwitter 我知道你可以在STTwitter上使用这种方法上传一张图片,但据我所知,这种方法不支持多张图片:

- (NSObject<STTwitterRequestProtocol> *)postMediaUpload:(NSURL *)mediaURL
                                    uploadProgressBlock:(void(^)(NSInteger bytesWritten, NSInteger totalBytesWritten, NSInteger totalBytesExpectedToWrite))uploadProgressBlock
                                           successBlock:(void(^)(NSDictionary *imageDictionary, NSString *mediaID, NSString *size))successBlock
                                             errorBlock:(void(^)(NSError *error))errorBlock
-(NSObject*)postMediaUpload:(NSURL*)mediaURL
uploadProgressBlock:(无效(^)(NSInteger BytesWrited、NSInteger TotalBytesWrited、NSInteger totalBytesExpectedToWrite))uploadProgressBlock
successBlock:(void(^)(NSDictionary*imageDictionary,NSString*mediaID,NSString*size))successBlock
errorBlock:(无效(^)(n错误*错误))errorBlock
值得一提的是,我正在使用Objective-C post媒体将其构建到iOS应用程序中,并存储其ID,如中所述

2) 发布状态并填写MediaID,如中所述

3) 没有第三步:-)


谢谢,这太棒了!如何在Twitter/Fabric新SDK中处理多个图像?你能帮我做点什么吗
for(NSString *filename in @[@"1.png", @"2.png", @"3.png", @"4.png"]) {
    NSString *filePath = [[@"~/Desktop/" stringByExpandingTildeInPath] stringByAppendingPathComponent:filename];
    NSURL *fileURL = [NSURL fileURLWithPath:filePath];

    [_twitter postMediaUpload:fileURL
          uploadProgressBlock:^(NSInteger bytesWritten, NSInteger totalBytesWritten, NSInteger totalBytesExpectedToWrite) {
              NSLog(@"..");
          } successBlock:^(NSDictionary *imageDictionary, NSString *mediaID, NSString *size) {
              NSLog(@"-- %@", mediaID);
          } errorBlock:^(NSError *error) {
              NSLog(@"-- %@", [error localizedDescription]);
          }];
}
[_twitter postStatusUpdate:@"hello"
         inReplyToStatusID:nil
                  mediaIDs:@[@"620502730948218882", @"620502730948239360", @"620502731610984448", @"620502731623534592"]
                  latitude:nil
                 longitude:nil
                   placeID:nil
        displayCoordinates:nil
                  trimUser:nil
              successBlock:^(NSDictionary *status) {
                  NSLog(@"-- %@", status);
              } errorBlock:^(NSError *error) {
                  NSLog(@"-- %@", [error localizedDescription]);
              }];