Reputation: 61
Is it possible to upload multiple images/videos to a webserver in backgroud with unlimited time. I have tried background modes but it gives limited time about 30sec.
If it's possible then How it's possible? If it's not possible then how Whatsapp and Facebook is doing that.
Upvotes: 1
Views: 913
Reputation: 2355
Background threads are cut after few (around five) seconds, which is a force quit.It worth to note that facebook and whatsup do nothing in background, they are just waiting for an event when they are suspended, however, if you close whatsup(swipe up), it is also possible to not recieve incoming messages!!!
Even if you somehow manage to do what you are about to do in background, apple will not publish your app in app-store;actually the biggest portion of application that are rejected by apple is due to not using background service properly.
You can not do an arbitrary task for an arbitrary time in background. There are certain type of applications that are allowed to be running in background without limitation such as an Audio Player application.
Still you are able to extend this 5s time by asking UIkit for extra time. Check this out.
Sadly, threads in background are so much slower, which makes the time you have even shorter!
Upvotes: 2