mzeeshanid / MZDownloadManager

This download manager uses NSURLSession api to download files. It can download multiple files at a time. It can download large files if app is in background. It can resume downloads if app was quit.
BSD 3-Clause "New" or "Revised" License
1.12k stars 238 forks source link

MZDownloadManager doesn't support ios 9.3 #21

Closed php1999 closed 8 years ago

php1999 commented 8 years ago

I tried to use MZDownloadManager with no success, one of classes has issue with ios 9. App working with ios 8 only. I hope you fix this asap. Thanks

mzeeshanid commented 8 years ago

Can you add more detail about the problem?

php1999 commented 8 years ago

App is building and running smoothly in ios 9.3 without giving any kind of errors or warnings but it can't download anything at all.

When I switch to ios 8.1 simulator the App download files with no issue at all.

Could you please give it a look and try to use xcode 7.3/ios 9.3 simulator or device.

Thanks

mzeeshanid commented 8 years ago

Well, the problem is not with the MZDownloadManager. Its your app's transport security settings. If you log the error from error delegate you will see this message: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection. To resolve this issue you can add App Transport Security Settings in plist and allow arbitrary loads. For details see this post.

php1999 commented 8 years ago

This is not the case, I already added App Transport security support.

This is the App log, also please check the attached image.

Thanks


"pending tasks (\n \"<NSCFBackgroundDownloadTask: 0x7fcb0480f590>{ taskIdentifier: 16 }\"\n)" "task id: 16" "session manager:<NSURLBackgroundSession: 0x7fcb024f8480> url:http://dl.dropbox.com/u/97700329/file1.mp4 request:<NSURLRequest: 0x7fcb02526e70> { URL: http://dl.dropbox.com/u/97700329/file1.mp4 }" "task id: 17" simulator screen shot jun 23 2016 9 01 53 am

mzeeshanid commented 8 years ago

Also log the error:

func downloadRequestDidFailedWithError(error: NSError, downloadModel: MZDownloadModel, index: Int) {
        self.safelyDismissAlertController()
        self.refreshCellForIndex(downloadModel, index: index)

        debugPrint("Error: \(error)")
    }

As it is working fine for me in iOS 9.3 with Xcode 7.3.1 simulator screen shot 23-jun-2016 11 21 41 am

php1999 commented 8 years ago

it works now.

I had to delete this header path: $(CACHE_ROOT)/SharedPrecompiledHeaders ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk/Developer/Library/Frameworks'

clean and build --> works, Thanks