4

I have a newsstand application which provides the downloads through the NKNewsstandKit.

My Problem is that when i start downloading a asset & terminate the application, it downloads in the background perfectly. It also invoke the application in background mode. But i did not get the event connectionDidFinishDownloading:

Does anyone even have an idea, how i can get the event & process my assets.

Amjad Khan
  • 393
  • 3
  • 13

1 Answers1

2

If you start downloading while the app is running and then terminate the app you won't get any asset download delegate methods called (there is a launch option UIApplicationLaunchOptionsNewsstandDownloadsKey which I expected in this case but I've never seen this happen). The best solution is when the user starts the app, resume downloading each of the assets in [[NKLibrary sharedLibrary] downloadingAssets] and you should get a connectionDidFinishDownloading for each that has already downloaded. Be sure to do this in the didFinishLaunchingWithOptions method on the main thread or the assets will be deleted.

Also see Detecting background app launch in Xcode to debug a Newsstand app and Newsstand resume download after the App closed by user Fully

Community
  • 1
  • 1
Martin Lockett
  • 2,275
  • 27
  • 31
  • Although this answer is accepted but what I am observing is different. Most of the time when my downloads completes I get connectionDidResumeDownloading called where I process (unzip) and move it to contentUrl of NKIssue. And sometime the download pauses in background (its all up to NS framework) and we should resume such downloads from didFinishLaunchingWithOptions. – msk Mar 21 '12 at 16:03