NSURLSession:后台上传然后调用服务api

编程入门 行业动态 更新时间:2024-10-27 18:30:15
本文介绍了NSURLSession:后台上传然后调用服务api的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我试图使用新的ios7后台传输api将一些照片上传到服务器。它现在发生的是 1)我们将字节上传到s3 2)调用服务api来完成上传

I was trying to use the new ios7 background transfer api to upload some photos to a server. what it happened now is 1) we upload the bytes to s3 2) call a service api to 'complete' the upload

我看了在这个文档和似乎背景NSURLSession不支持'数据'任务。这是否意味着我在实际上传完成后无法在后台执行第2步?

i looked at this doc and it seems background NSURLSession doesn't support 'data' task. does that mean i can't do the step 2 in background after the actual upload is done?

推荐答案

如果你想要更简单解决方案,而不是重新利用 NSURLSessionDownloadTask 进行已完成的API调用,您可以在回调期间快速进行快速http调用:

If you want a simpler solution than repurposing NSURLSessionDownloadTask for your "completed" API call, you can round trip a quick http call during the callback in:

-URLSession:task:didCompleteWithError:

更多推荐

NSURLSession:后台上传然后调用服务api

本文发布于:2023-11-26 05:48:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1632882.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:后台   上传   NSURLSession   api

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!