ios - NSURLSession background upload - need to enable background modes? -
i instantiating nsurlsession
several background uploads this:
sessionconfiguration = [nsurlsessionconfiguration backgroundsessionconfigurationwithidentifier:myidentifier];
everything seems work ok part, wondering if need add in p.list background fetch key if doing background uploads , not downloads?. not able find documentation saying should or should not. on xcode 5 +, know if under capabilities>background modes, should enable or not background fetch, if doing background uploads, note read response after upload complete, considered "download".
the official guide background execution declare 3 type of background executions:
- executing finite-length tasks - using
uiapplication
method
beginbackgroundtaskwithname:expirationhandler:
execute finite time task. - downloading content in background - using
nsurlsession
download content.nsurlsession
provided app run on separate system level daemon , when done, gets app completion handler. (your above mentioned implementation) - implementing long-running tasks - tasks needs running long time, handled under category, audio, voip, location, download processes, update contents. these type of tasks needs special
uibackgroundmodes
key mentioned in info.plist.
so answering question, don't need uibackgroundmodes
key, until don't fall in long-running tasks category.
Comments
Post a Comment