Wednesday, July 2, 2014

What happens when an IBackgroundTask is killed by Windows

Hi Matt,


The uploads are actually Dropbox uploads using the Dropbox 'Core API', so I am not sure (though I don't know for definite) that the BackgroundTransfer API is going to be able to handle that. I did have a bash with the BackgroundTransfer previously but could not get it to work with Dropbox. If it was possible then this would be a preferred solution.


If not, then I will just have to code in a workaround. I do use timeouts in my code already (so the app will not hang), but the problem will come if the IBackgroundTask does not let go of the Semaphore, which will prevent both the foreground app and future runs of the background task from doing any uploading. I can get around this by fully releasing the semaphore when the foreground app is suspended (there may be some edge cases where this would be dangerous, but would probably work 99.999% of the time).


No comments:

Post a Comment