I am using wifi connection with my app I can download files but when I change the connection to mobile network app is working but not downloading files.
-(NSURLSession *)defaultSession {
if (_defaultSession == nil) {
NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration];
config.allowsCellularAccess = NO;
_defaultSession = [NSURLSession sessionWithConfiguration: config delegate: self delegateQueue: [NSOperationQueue mainQueue]];
}
return _defaultSession;
CodePudding user response:
Change the following line
config.allowsCellularAccess = NO;
to
config.allowsCellularAccess = YES;
CodePudding user response:
[1][I am still confusing why I am not able to download and see files on my mobile network but it works when I change to Wifi connection. Any help appreciate it!][2]
[and here is the my error message code session] [2]: https://i.stack.imgur.com/DoJ0m.png