This repository was archived by the owner on Mar 16, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ - (void) sendRequest:(NSDictionary * _Nullable )options
92
92
93
93
// the session trust any SSL certification
94
94
95
- NSURLSessionConfiguration *defaultConfigObject = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier: taskId ];
95
+ NSURLSessionConfiguration *defaultConfigObject = [NSURLSessionConfiguration defaultSessionConfiguration ];
96
96
session = [NSURLSession sessionWithConfiguration: defaultConfigObject delegate: self delegateQueue: [NSOperationQueue mainQueue ]];
97
97
98
98
if (path != nil || [self .options valueForKey: CONFIG_USE_TEMP]!= nil )
@@ -168,25 +168,21 @@ - (void) URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dat
168
168
}
169
169
];
170
170
171
- if (receivedBytes >= expectedBytes)
172
- {
173
- if (respFile == YES )
174
- {
175
- [writeStream close ];
176
- callback (@[[NSNull null ], destPath]);
177
- }
178
- // base64 response
179
- else {
180
- callback (@[[NSNull null ], [respData base64EncodedStringWithOptions: 0 ]]);
181
- }
182
- [[UIApplication sharedApplication ] setNetworkActivityIndicatorVisible: NO ];
183
- }
184
171
}
185
172
186
173
- (void ) URLSession : (NSURLSession *)session task : (NSURLSessionTask *)task didCompleteWithError : (NSError *)error {
187
174
NSLog ([error localizedDescription ]);
188
175
self.error = error;
189
176
[[UIApplication sharedApplication ] setNetworkActivityIndicatorVisible: NO ];
177
+ if (respFile == YES )
178
+ {
179
+ [writeStream close ];
180
+ callback (@[error == nil ? [NSNull null ] : [error localizedDescription ], destPath]);
181
+ }
182
+ // base64 response
183
+ else {
184
+ callback (@[error == nil ? [NSNull null ] : [error localizedDescription ], [respData base64EncodedStringWithOptions: 0 ]]);
185
+ }
190
186
}
191
187
192
188
// upload progress handler
You can’t perform that action at this time.
0 commit comments