CFNetwork的SSLHandshake使用NSURLSession失败(-9806)错误,当应用程序在后台为uploadTask [英] CFNetwork SSLHandshake failed (-9806) error using NSURLSession when app in background for an uploadTask

查看:354
本文介绍了CFNetwork的SSLHandshake使用NSURLSession失败(-9806)错误,当应用程序在后台为uploadTask的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在面临一个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 的处理很多不同的事情,包括身份验证。我建议你​​仔细阅读有关苹果的背景会话和任务的一切<一个href=\"https://developer.apple.com/library/mac/documentation/cocoa/conceptual/urlloadingsystem/Articles/UsingNSURLSession.html#//apple_ref/doc/uid/TP40013509-SW44\"相对=nofollow>网址加载系统编程指南,尤其是在后台传输注意事项栏目

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:

<一个href=\"https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSURLSessionDelegate_protocol/Reference/Reference.html#//apple_ref/occ/intfm/NSURLSessionDelegate/URLSession%3adidReceiveChallenge%3acompletionHandler%3a\"相对=nofollow> - [NSURLSessionDelegate URLSession:didReceiveChallenge:completionHandler:]

这篇关于CFNetwork的SSLHandshake使用NSURLSession失败(-9806)错误,当应用程序在后台为uploadTask的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆