Reputation: 7957
We have an iPad app that is designed to download data that the user may read when no longer connected to wifi. When it does download, it fetches thousands of PDFs. Occasionally while testing the fetching I experience the following behaviour:
NSURLConnection
calls its didFailWithError
with either NSURLErrorNotConnectedToInternet
or NSURLErrorNetworkConnectionLost
as its error and the wifi indicator in the top left disappears.Is there some iOS feature that prevents too much downloading? Is there some method I can call to prevent this from happening?
This issue (http://stackoverflow.com/questions/8121526/wifi-drops-in-ipod-after-a-while-running-my-application) deals with a similar issue and points to the UIRequiresPersistentWiFi
flag (see http://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW12). The problem is that the app is intentionally designed to not require persistent wifi.
A couple of other tidbits:
NSURLConnections
are spawned from a background thread
with 5 active connections simultaneously.Upvotes: 0
Views: 1185
Reputation: 2537
I can confirm that iOS 5.1 is having issues with maintaining a wifi connection. There are a lot of forum posts about it around the world wide interweb, but here's my evidence:
We have 6 iPad 2's set up in a museum gallery. 3 are running 5.1 and 3 are running 5.0.1. The 3 iPads running 5.1 are constantly disconnecting from the access point. The 3 running 5.0.1 have no issues and haven't had issues for weeks. They are running the same app, off the same network with nothing else installed and identical settings applied. I'm reverting back and submitting a notice to Apple about it. I'll be reverting all iPads to 5.0.1.
Side Note: I am an IT professional and together with our System Admin we ruled out all issues with our internal network, access points, and connectivity over a slew of devices. Only devices running 5.1 (iPhones and iPads alike) are having issues.
EDIT: Downgrading is no longer possible. Once on 5.1, stuck on 5.1. I did find a reference to someone having this problem as well and solving it by adding a row to the app's plist. Under supporting files, go to your app's plist file and add the following row: Application uses Wi-Fi YES
. Apparently the iPad has been designed to turn off the Wi-Fi adapter after 30 minutes of user inactivity (I have tested and confirmed this to be accurate). Inactivity being physical inactivity, not data inactivity. Supposedly adding this line overrides that if the app is open. I have yet to test this, but will as soon as I have the extended period of time to try it out. 5.0.1 (and perhaps a few earlier versions) may have "broken" this battery saving feature. And, in turn, 5.1 may have "fixed" the problem of Wi-Fi not turning off to save battery. I see it as a break because of my app, but who knows.
Upvotes: 3