nsurlsessiondownloadtask

BackgroundSession SessionDownloadTask when locking screen, Error: NSPOSIXErrorDomain Code = 1

為{幸葍}努か 提交于 2019-12-05 10:21:39
I have a NSURLSessionDownloadTask with a backgroundSessionConfigurationWithIdentifier . When I lock the screen, this exception occurs: Error Domain = NSPOSIXErrorDomain Code = 1 "The operation could not be completed Operation not permitted.". This error occurs only on my phone, it does not appear on other phones. below is the simple code: NSURLSessionConfiguration *sessionConfiguration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:@"com.edu.downLoadTest"];; AFURLSessionManager *_session = [[AFURLSessionManager alloc] initWithSessionConfiguration:sessionConfiguration

NSURLSessionDownloadTask cancelByProducingResumeData return null

让人想犯罪 __ 提交于 2019-12-04 19:34:58
I use NSURLSessionDownloadTask to download a file from server, it is run in a background session. I want to save resume data to resume the download when the app is terminated. However, the call of cancelByProducingResumeData always returns null. I cannot figure out the issue, cause I used to do a sample of resumable download task successful before. Does anybody get the same issue? Do you know if the request satisfies the criteria outlined in the documentation for the cancelByProducingResumeData method? A download can be resumed only if the following conditions are met: The resource has not

What is difference between NSURLSessionDataTask vs NSURLSessionDownloadTask

本小妞迷上赌 提交于 2019-12-03 10:48:00
问题 In latest apple introduce new NSURLSession in replace of NSURLConnection , so in there are different task , so what is the difference between NSURLSessionDataTask , NSURLSessionDownloadTask ? and in which scenario use NSURLSessionTask and where NSURLSessionDownloadTask ? 回答1: NSURLSessionDataTask : Data tasks exchange data using NSData. NSURLSessionDataTask is not supported in Background Sessions. Data tasks send and receive data using NSData objects. Data tasks are intended for short, often

How to resume NSURLSession download process after app force-quit and app relaunch?

久未见 提交于 2019-12-03 08:06:16
问题 I have implemented NSURLSession for downloading fairly large files from our servers. Now as long as I'm working in foreground or background and go back to the app the transactions are working and getting finished. But if I force-quit the app using the the multitasking screen and re-open the app again. the downloading process is not getting finished although as I understood from the docs, it should, here what the docs state: If an iOS app is terminated by the system and relaunched, the app can

NSURLSessionTask never calls back after timeout when using background configuration

耗尽温柔 提交于 2019-12-03 05:47:17
问题 I am using NSURLSessionDownloadTask with background sessions to achieve all my REST requests. This way I can use the same code without have to think about my application being in background or in foreground. My back-end has been dead for a while, and I have taken that opportunity to test how does NSURLSession behave with timeouts. To my utter surprise, none of my NSURLSessionTaskDelegate callbacks ever gets called. Whatever timeout I set on the NSURLRequest or on the NSURLSessionConfiguration

Stream video while downloading iOS

拈花ヽ惹草 提交于 2019-12-03 01:32:47
问题 I am using iOS 7 and I have a .mp4 video that I need to download in my app. The video is large (~ 1 GB) which is why it is not included as part of the app. I want the user to be able to start watching the video as soon as is starts downloading. I also want the video to be able to be cached on the iOS device so the user doesn't need to download it again later. Both the normal methods of playing videos (progressive download and live streaming) don't seem to let you cache the video, so I have

What is difference between NSURLSessionDataTask vs NSURLSessionDownloadTask

断了今生、忘了曾经 提交于 2019-12-03 01:21:53
In latest apple introduce new NSURLSession in replace of NSURLConnection , so in there are different task , so what is the difference between NSURLSessionDataTask , NSURLSessionDownloadTask ? and in which scenario use NSURLSessionTask and where NSURLSessionDownloadTask ? NSURLSessionDataTask : Data tasks exchange data using NSData. NSURLSessionDataTask is not supported in Background Sessions. Data tasks send and receive data using NSData objects. Data tasks are intended for short, often interactive requests from your app to a server. Data tasks can return data to your app one piece at a time

How to resume NSURLSession download process after app force-quit and app relaunch?

牧云@^-^@ 提交于 2019-12-02 20:44:57
I have implemented NSURLSession for downloading fairly large files from our servers. Now as long as I'm working in foreground or background and go back to the app the transactions are working and getting finished. But if I force-quit the app using the the multitasking screen and re-open the app again. the downloading process is not getting finished although as I understood from the docs, it should, here what the docs state: If an iOS app is terminated by the system and relaunched, the app can use the same identifier to create a new configuration object and session and retrieve the status of

NSURLSessionTask never calls back after timeout when using background configuration

末鹿安然 提交于 2019-12-02 19:08:57
I am using NSURLSessionDownloadTask with background sessions to achieve all my REST requests. This way I can use the same code without have to think about my application being in background or in foreground. My back-end has been dead for a while, and I have taken that opportunity to test how does NSURLSession behave with timeouts. To my utter surprise, none of my NSURLSessionTaskDelegate callbacks ever gets called. Whatever timeout I set on the NSURLRequest or on the NSURLSessionConfiguration , I never get any callback from iOS telling me that the request did finish with timeout. That is, when

Stream video while downloading iOS

强颜欢笑 提交于 2019-12-02 14:58:24
I am using iOS 7 and I have a .mp4 video that I need to download in my app. The video is large (~ 1 GB) which is why it is not included as part of the app. I want the user to be able to start watching the video as soon as is starts downloading. I also want the video to be able to be cached on the iOS device so the user doesn't need to download it again later. Both the normal methods of playing videos (progressive download and live streaming) don't seem to let you cache the video, so I have made my own web service that chunks up my video file and streams the bytes down to the client. I start