简体   繁体   English

在iOS应用中长时间下载

[英]Long time downloading in iOS app

How many issues need to be considered carefully if a large of content need to be downloaded in an iOS app ? 如果需要在iOS应用中下载大量内容,则需要仔细考虑几个问题?

Here are my known issues: 这是我的已知问题:

  1. Network , No limits for Wifi, but Apple has limit policy for cellular network. 网络,Wifi上网无限制,但Apple对蜂窝网络有限制政策。 enter link description here 在此处输入链接说明
  2. Background execution. 后台执行。 Apple introduced multitasking for several cases, but no for downloading large content background. 苹果公司在几种情况下引入了多任务处理,但没有下载大型内容背景。 Here is a good analysis . 这是一个很好的分析
  3. Newsstand provides good solution for this. 报亭为此提供了很好的解决方案。 But does that mean you need follow the Newsstand approach ? 但这是否意味着您需要遵循报亭的方法? We do not want to build an newsstand type app. 我们不想构建报亭类型的应用程序。

What else issues do you think ? 您还认为其他什么问题? and what is the best solution for this sort of problem ? 那么解决此类问题的最佳解决方案是什么?

I would lazy load only data as needed. 我会根据需要懒惰地仅加载数据。 When the user requests an area load revenant data. 当用户请求区域负载保留数据时。 If you want to preload do it in the background. 如果要预加载,请在后台执行。 I have seen 1.6Gb apps with lots of videos, embedded in main bundle, but that was for sales app that needed to have all videos ready to go and could not assume any active network connection. 我见过1.6Gb应用程序,其中包含很多视频,这些视频都嵌入在主捆绑包中,但这是针对销售应用程序的,它需要准备好所有视频并且不能假定任何活动的网络连接。

Download the data you need in a background thread while your app is running. 在应用运行时,在后台线程中下载所需的数据。 If your app is terminated or suspended before you get all the data, resume where you left off the next time the app is running. 如果您的应用在获得所有数据之前被终止或暂停,请在下次运行该应用时从上次中断的位置继续。 There are a number of ways that you can do that; 您可以通过多种方式进行操作。 one good one is to break your data up into smaller chunks that can be downloaded sequentially. 一个好的办法是将您的数据分成较小的块,这些块可以顺序下载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM