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:

  1. executing finite-length tasks - using uiapplication method
    beginbackgroundtaskwithname:expirationhandler: execute finite time task.
  2. 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)
  3. 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

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -