Further: the WiFi connection appears to be disconnected by the iOS after a few minutes, probably because of the "background task completion" time limit. So the problem is limited. But I think you should do some more work on the app to implement it correctly.