SWIFT: Get high priority for my app to use internet data

486 Views Asked by At

I have data intensive app that heavily relies on web services. iOS does not let it use data where as at the same time other applications(like youtube) can get high data volume.

The same app works flawlessly on android.

How can I programmatically get high priority for my app for internet data usage?
I'm using Swift 2.3.

1

There are 1 best solutions below

1
On

It could be, that you have to set a higher timoutIntervall for the request. I had a similar problem, where the request took to long and could not finished loading the data. I found out that the request is by default set to 60 seconds or something like this.

So try to set

let request = NSMutableURLRequest(url: searchURL, cachePolicy: NSMutableURLRequest.CachePolicy.reloadIgnoringLocalAndRemoteCacheData, timeoutInterval: 300)

to a higher value like 300.

So it is not the amount of data, it is because of time it takes to download it.

Maybe this will help.