问题描述
我现在面临一个CFNetwork的SSL握手错误上载使用NSURLSession UploadTask视频文件时,应用程序是在后台。这是没有问题上传视频时,应用程序是在前台。问题出现了,只有当应用程序是在后台。
I am facing a CFNetwork SSL Handshake error while uploading a video file using NSURLSession UploadTask when the App is in background. There is no problem uploading the videos when the app is in foreground. Problem arises only when the app is in background.
推荐答案
后台运行 NSURLSession
的处理很多不同的事情,包括身份验证。我建议你仔细阅读有关苹果的背景会话和任务的一切网址加载系统编程指南,尤其是在后台传输注意事项栏目
Backgrounded NSURLSession
's handle a lot of things differently, including auth. I'd recommend you carefully read everything about background sessions and tasks in Apple's URL Loading System Programming Guide, particularly the section on Background Transfer Considerations.
您也可以尝试看看,当你设置它实现了回调的会话委托你会得到什么:
You might also try see what you get when you set a session delegate which implements the callback:
- [NSURLSessionDelegate URLSession:didReceiveChallenge:completionHandler:]
这篇关于CFNetwork的SSLHandshake使用NSURLSession失败(-9806)错误,当应用程序在后台为uploadTask的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!