Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNI场景NSURLProtocol方案不支持后台下载 #10

Open
shixiaoda opened this issue Jun 20, 2018 · 1 comment
Open

SNI场景NSURLProtocol方案不支持后台下载 #10

shixiaoda opened this issue Jun 20, 2018 · 1 comment

Comments

@shixiaoda
Copy link

苹果文档:
Custom NSURLProtocol subclasses are not available to background
sessions.

@HuYuee
Copy link
Collaborator

HuYuee commented Dec 9, 2024

在 iOS 中,NSURLProtocol 的自定义子类不能在后台会话(NSURLSession 的后台配置)中使用。这是因为后台会话的设计目的是为了处理长时间运行的任务,而自定义的 NSURLProtocol 可能会干扰这些任务的管理。
如果您的自定义 NSURLProtocol 主要用于处理请求的逻辑(例如,缓存、重定向等),您可以将这些逻辑移到您的网络请求的实现中,而不是依赖于 NSURLProtocol。例如,您可以在发起请求之前手动处理请求的缓存或重定向。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants