iOS Background downloads when the app is not active

后端 未结 8 1446
日久生厌
日久生厌 2020-11-27 13:28

When my app is initially downloaded, the user needs to download a large file something like 200MB (upper limit). I definitely can\'t expect the user to keep the app open til

相关标签:
8条回答
  • 2020-11-27 13:45

    Unfortunately most answers here are outdated in 2020! iOS 13 reduces the time of -beginBackgroundTaskWithExpirationHandler: to seconds from minutes and also kills the app with adverse effects. I also consider disabling auto screensaver mode for the duration of the download. More information can be found here:

    • https://developer.apple.com/documentation/foundation/url_loading_system/downloading_files_in_the_background?language=objc
    • https://developer.apple.com/documentation/backgroundtasks/choosing_background_strategies_for_your_app?language=objc
    0 讨论(0)
  • 2020-11-27 13:52

    Build a newsStand iOS application; not a standart iOS application.

    Standart iOS aplications:

    • can not download data when closed.
    • can download data in limited time when pushed to background.
    • Not enough time to download 200mb.

    NewsStand applications have an extra time privilege to download when closed or inBackground. Once in every 24 hours, they have a privilege to answer a remoteContentReady delegate call.

    Building a newsStand application is no different than building a standart iOS application. You will just mark it as newStand application.

    Then you will have privilege to run code which is inside remoteContentReady delegation.

    To receive remoteContentReady signal, you have to send a signal from your serverside (c#, php, bla bla).

    Not to every single iOS app. Something like a remoteNotification signal. You may need ssl certification for your website in order to accomplish this.

    Best Regards

    0 讨论(0)
提交回复
热议问题