From 9aeb0b844007ce5f711ca3aa7d5832fe611e8113 Mon Sep 17 00:00:00 2001 From: Bader Serhan Date: Thu, 28 Mar 2019 16:44:55 +0200 Subject: [PATCH] upload more than 2 videos at the same time --- ios/VydiaRNFileUploader.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/VydiaRNFileUploader.m b/ios/VydiaRNFileUploader.m index 65b0c687..4e57b8cc 100644 --- a/ios/VydiaRNFileUploader.m +++ b/ios/VydiaRNFileUploader.m @@ -197,8 +197,8 @@ - (void)copyAssetToFile: (NSString *)assetUrl completionHandler: (void(^)(NSStri NSData *httpBody = [self createBodyWithBoundary:uuidStr path:fileURI parameters: parameters fieldName:fieldName]; [request setHTTPBody: httpBody]; - // I am sorry about warning, but Upload tasks from NSData are not supported in background sessions. - uploadTask = [[self urlSession] uploadTaskWithRequest:request fromData: nil]; + //using uploadTaskWithStreamedRequest instead of uploadTaskWithRequest to ensure more than 2 video uploads at the same time + uploadTask = [[self urlSession] uploadTaskWithStreamedRequest:request]; } else { if (parameters.count > 0) { reject(@"RN Uploader", @"Parameters supported only in multipart type", nil);