Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit 8902983

Browse files
committed
#24 Remove redundant code.
1 parent c67f368 commit 8902983

File tree

1 file changed

+2
-65
lines changed

1 file changed

+2
-65
lines changed

src/ios/RNFetchBlobResp.m

Lines changed: 2 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,12 @@ - (void) sendRequest:(NSDictionary *)options bridge:(RCTBridge *)bridgeRef taskI
112112
callback(@[[error localizedDescription]]);
113113
return;
114114
}
115-
else
115+
else {
116116
callback(@[[NSNull null], [resp base64EncodedStringWithOptions:0]]);
117+
}
117118
}];
118-
// [session uploadTaskWithRequest:req fromData:data completionHandler:^(NSData * _Nullable resp, NSURLResponse * _Nullable response, NSError * _Nullable error) {
119-
// if(error != nil) {
120-
// callback(@[[error localizedDescription]]);
121-
// return;
122-
// }
123-
// else
124-
// callback(@[[NSNull null], [resp base64EncodedStringWithOptions:0]]);
125-
// }];
126119
[task resume];
127120
}
128-
// callback(@[[NSString stringWithFormat:@"RNFetchBlob could not initialize connection"], [NSNull null]]);
129121
}
130122

131123

@@ -171,59 +163,4 @@ - (void) URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didSen
171163
];
172164
}
173165

174-
175-
//- (void) URLSessionDidFinishEventsForBackgroundURLSession:(NSURLSession *)session
176-
//{
177-
//
178-
//}
179-
180-
181-
//- (void) connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
182-
//
183-
// // [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
184-
//
185-
// [self.fileStream closeInStream];
186-
// [self.fileStream closeOutStream];
187-
//
188-
// callback(@[[error localizedDescription], [NSNull null]]);
189-
//}
190-
191-
192-
193-
194-
// handle 301 and 302 responses
195-
//- (NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResponse:response {
196-
// return request;
197-
//}
198-
199-
// request complete
200-
//- (void) connectionDidFinishLoading:(NSURLConnection *)connection {
201-
//
202-
// NSData * data;
203-
// if(respData != nil)
204-
// data = [NSData dataWithData:respData];
205-
// else
206-
// data = [[NSData alloc] init];
207-
//
208-
// NSString * path = [self.options valueForKey:CONFIG_FILE_PATH];
209-
// NSString * ext = [self.options valueForKey:CONFIG_FILE_EXT];
210-
// Boolean useCache = [self.options valueForKey:CONFIG_USE_TEMP];
211-
//
212-
// [self.fileStream closeInStream];
213-
//
214-
// // if fileCache is true or file path is given, return a path
215-
// if( path != nil ) {
216-
// callback(@[[NSNull null], path]);
217-
// }
218-
// // when fileCache option is set but no path specified, save to tmp path
219-
// else if( [self.options valueForKey:CONFIG_USE_TEMP] != nil) {
220-
// NSString * tmpPath = [RNFetchBlobFS getTempPath:taskId withExtension:ext];
221-
// callback(@[[NSNull null], tmpPath]);
222-
// }
223-
// // otherwise return base64 string
224-
// else {
225-
// callback(@[[NSNull null], [data base64EncodedStringWithOptions:0]]);
226-
// }
227-
//}
228-
229166
@end

0 commit comments

Comments
 (0)