thinhquangtran
thinhquangtran

Reputation: 21

How to programmatically keep wifi alive in sleep mode

I'm programming download data from my server. My idea: i set time for download, my app is running in background, my device on battery charging. When my device is sleeping, if schedule on time, app download data. But, wifi sleep when device sleep. How to re-active or keep wifi alive.

Upvotes: 2

Views: 3276

Answers (2)

jtbandes
jtbandes

Reputation: 118681

Try setting the UIRequiresPersistentWiFi key in your Info.plist.

Upvotes: 3

Deepak Danduprolu
Deepak Danduprolu

Reputation: 44633

If your app is in the background, you can't run in the background automatically. You will need the user's approval to download the new content. It will have to come out of sleep for such a thing to occur.

Upvotes: 0

Related Questions