菜鸟教程小白 发表于 2022-12-11 20:05:45

ios - 继续在后台从服务中获取数据


                                            <p><p>我在下载过程中在前台调用 web 服务,我按下主页按钮(应用程序现在在后台),我想在后台继续获取/下载并完成它,这在 iOS 中可能吗?如果是,那我该如何实现呢?</p>

<p>提前致谢。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>请使用<code>URLSessionDownloadTask</code>在后台下载任意数据,并在capabilities中开启后台模式下的<code>Background fetch</code>。</p>

<p> <a href="/image/eW3kB.png" rel="noreferrer noopener nofollow"><img src="/image/eW3kB.png" alt="Background Fetch"/></a> </p>

<p>更多信息请引用,
<a href="https://www.ralfebert.de/ios-examples/networking/urlsession-background-downloads/" rel="noreferrer noopener nofollow">Downloading files in background</a> </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 继续在后台从服务中获取数据,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/50094654/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/50094654/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 继续在后台从服务中获取数据