gpt4 book ai didi

ios - 后台获取超过30秒

转载 作者:行者123 更新时间:2023-12-01 16:28:59 24 4
gpt4 key购买 nike

我正在开发一个iOS应用,必须在其中下载多个zip捆绑包。
为了处理下载,我使用内部C++ http-framework。

是否有可能进行Background-Fetch超过30秒?

一种可能是将NSURLSessionNSURLSessionDownloadTask一起使用,但是http-framework不使用NSURLSession。

另一个解决方案是:

-(void)application:(UIApplication *)application performFetchWithCompletionHandler:(void(^)(UIBackgroundFetchResult))completionHandler{}

但这只能持续30秒。

但是,如何下载带有 Background-Fetch的Zip文件超过30秒?

最佳答案

您可以尝试在didEnterBackground方法中的UIApplication上调用 beginBackgroundTaskWithName:expirationHandler: beginBackgroundTaskWithExpirationHandler:方法(并在完成时调用 endBackgroundTask ),但这仍然不会花费您大约三分钟的时间。

但是,要正确执行此操作,您实际上必须使用NSURLSession。

关于ios - 后台获取超过30秒,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33268434/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com