NSURLSession: uploading assets with background transfer

前端 未结 1 1203
旧时难觅i
旧时难觅i 2020-12-10 19:21

What\'s the best approach to use background transfer to upload assets from gallery?

Seems like uploadTaskWithRequest:fromData: doesn\'t work with

1条回答
  •  遥遥无期
    2020-12-10 19:32

    They also say somewhere in documentation that Upload/download urls support only file http https schemes. Background supports only http/https.
    I believe that core data and assets library urls despite being technically valid urls aren't really urls, and most likely aren't implemented by creating custom NSurlprotocol-s.

    So I am inclined to believe that you should write the asset to some file and pass a URL to that file to upload task. I'm working on a project that uploads assets as well and I have just begun converting it to nsursession using background session. So I'll try this out for myself later today to prove the theory.

    0 讨论(0)
提交回复
热议问题