@@ -462,13 +462,15 @@ - (void)uploadFiles:(CDVInvokedUrlCommand*)command {
462462 CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsDictionary: dictionary];
463463 [weakSelf.commandDelegate sendPluginResult: pluginResult callbackId: command.callbackId];
464464 [[SDNetworkActivityIndicator sharedActivityIndicator ] stopActivity ];
465+ [manager invalidateSessionCancelingTasks: YES ];
465466 } failure: ^(NSURLSessionTask *task, NSError *error) {
466467 NSMutableDictionary *dictionary = [NSMutableDictionary dictionary ];
467468 [self handleError: dictionary withResponse: (NSHTTPURLResponse *)task.response error: error];
468469
469470 CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsDictionary: dictionary];
470471 [weakSelf.commandDelegate sendPluginResult: pluginResult callbackId: command.callbackId];
471472 [[SDNetworkActivityIndicator sharedActivityIndicator ] stopActivity ];
473+ [manager invalidateSessionCancelingTasks: YES ];
472474 }];
473475 }
474476 @catch (NSException *exception) {
@@ -539,6 +541,7 @@ - (void)downloadFile:(CDVInvokedUrlCommand*)command {
539541 CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsDictionary: dictionary];
540542 [weakSelf.commandDelegate sendPluginResult: pluginResult callbackId: command.callbackId];
541543 [[SDNetworkActivityIndicator sharedActivityIndicator ] stopActivity ];
544+ [manager invalidateSessionCancelingTasks: YES ];
542545 return ;
543546 }
544547 NSData *data = (NSData *)responseObject;
@@ -549,6 +552,7 @@ - (void)downloadFile:(CDVInvokedUrlCommand*)command {
549552 CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsDictionary: dictionary];
550553 [weakSelf.commandDelegate sendPluginResult: pluginResult callbackId: command.callbackId];
551554 [[SDNetworkActivityIndicator sharedActivityIndicator ] stopActivity ];
555+ [manager invalidateSessionCancelingTasks: YES ];
552556 return ;
553557 }
554558
@@ -560,6 +564,7 @@ - (void)downloadFile:(CDVInvokedUrlCommand*)command {
560564 CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsDictionary: dictionary];
561565 [weakSelf.commandDelegate sendPluginResult: pluginResult callbackId: command.callbackId];
562566 [[SDNetworkActivityIndicator sharedActivityIndicator ] stopActivity ];
567+ [manager invalidateSessionCancelingTasks: YES ];
563568 } failure: ^(NSURLSessionTask *task, NSError *error) {
564569 NSMutableDictionary *dictionary = [NSMutableDictionary dictionary ];
565570 [self handleError: dictionary withResponse: (NSHTTPURLResponse *)task.response error: error];
@@ -568,6 +573,7 @@ - (void)downloadFile:(CDVInvokedUrlCommand*)command {
568573 CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsDictionary: dictionary];
569574 [weakSelf.commandDelegate sendPluginResult: pluginResult callbackId: command.callbackId];
570575 [[SDNetworkActivityIndicator sharedActivityIndicator ] stopActivity ];
576+ [manager invalidateSessionCancelingTasks: YES ];
571577 }];
572578 }
573579 @catch (NSException *exception) {
0 commit comments