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, wi开发者_Go百科fi sleep when device sleep. How to re-active or keep wifi alive.
Try setting the UIRequiresPersistentWiFi key in your Info.plist.
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.
精彩评论