我知道您可以在一条推特中最多上传四个图像,所以我想知道这是否可能,可能使用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值得一提的是,我正在使用Objective构建一个iOS应用程序。
发布于 2015-07-13 08:05:18
1)发布媒体并存储它们的ID,如后媒体/上载中所记录的
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]);
}];
}2)发布状态和填充媒体in,如员额状态/更新中所记录的
[_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]);
}];3)没有第三步:-)
https://stackoverflow.com/questions/31368963
复制相似问题