When I try to start a basic NSURLSession transfer while the network is offline (air plane mode), with NSURLSessionConfiguration defaultSessionConfiguration and ephemeralSessionConfiguration, I of course immediately receive the NSError :
Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline."
But with NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier, the NSURLSession never returns, no response in any way, no timeout fired, it get stucked.
This happens with iOS 8.x. With iOS 7.x, I got the NSError as expected.
Why that ? Is there a way to get some error back ?
NSURLSession background transfer timeout not fired
654 Views Asked by user3048615 At
1
There are 1 best solutions below
Related Questions in IOS
- Overlapping UICollectionView in storyboard
- Cannot pod spec lint because of undeclared type errors
- Is the transactionReceipt data present in dataWithContentsOfURL?
- UIWebView Screen Fitting Issue
- ZXingObjC encoding issues
- iOS: None of the valid provisioning profiles allowed the specific entitlements
- How to hide "Now playing url" in control center
- CloudKit: Preventing Duplicate Records
- Slow performance on ipad erasing image
- Swift code with multiple NSDateFormatter - optimization
- iOS 8.3 Safari crashes on input type=file
- TTTTimeIntervalFormatter always returns strings in English
- How do I add multiple in app purchases in Swift Spritekit?
- Setup code for xibs in iOS. -awakFromNb:
- iOS Voice Over only reads out the title of any alert views
Related Questions in TIMEOUT
- Function timeouts in C and thread
- RubyOnRails multiple database connections errors
- Debugging a 404 error for an existing page
- HttpWebRequest timing out, but no packets leaving client
- Multipart/form-data POST request gets timeout and is never sent using AFNetworking
- How to prevent timeout when running a time consuming PHP
- RequireJS module load timeout when using bundles
- OkHttp/Retrofit default timeout
- jetty replay request on timeout
- BASH - Getting an rsh command to return a value or to timeout
- ShareFile upload with Python 2.7.5 code timesout on FTPS STOR
- This page cannot be displayed error when calling a long stored procedure
- Javascript reruning timeout after being cleared
- Retrieve the data from sql database and don`t encounter timeout exception
- AmazonEc2InstanceDataPropertySource.getProperty() is extremely slow when run outside of Amazon
Related Questions in NSURLSESSION
- Using NSURLSession from a Swift command line program
- NSURLSession/NSURLConnection HTTP load failed on iOS 9
- How to send HTTPS POST request in swift using NSURLSession
- Can someone find the error and verify my Swift NSURLSession code?
- UI Slow to Update *ONLY* If Called In Response To Change Occurring in NSURLSessionUploadTask Completion Block
- Resuming tasks using NSURLSession when app removed from background or on device reboot
- URLSession:didBecomeInvalidWithError: - should completion handler be called?
- I am having trouble parsing JSON that is returned from the NSURL session. What am I doing wrong?
- NSHTTPURLResponse Status Code 200 in Airplane Mode
- NSURLSession ignoring NSURLSessionConfiguration Cache Policy
- Is There A Neat Way to Attach a Completion Block to an NSURLSessionDataDelegate Callback in Swift?
- Swift dataTaskWithRequest completion block not executed
- Multiple NSURLSessions Causing UITableView Problems
- Cancel NSURLSession if user taps twice in swift iOS
- NSURLSession background transfer timeout not fired
Related Questions in NSURLSESSIONCONFIGURATION
- NSURLSession ignoring NSURLSessionConfiguration Cache Policy
- NSURLSession background transfer timeout not fired
- Error when submitting download task with background session in Swift
- How to do Client Certificate Authentication using NSURLSession with background session configuration?
- Register NSURLProtocol (URLProtocol) class for use with external app?
- NSURLSession concurrent requests with Alamofire
- How to upload task in background using afnetworking
- Multiple background downloads in ios7 using NSURLSessionConfigurations
- NSURLSessionConfiguration timeoutIntervalForRequest doesn't seem to work with the background session
- Cannot invoke 'dataTask' with an argument list of type (with: NSMutableRequest, ...)
- Best place to call `completionHandler` received in `handleEventsForBackgroundURLSession` in case of uploading?
- NSURLSessionWebSocketDelegate delegates not being called iOS Objective c
- iOS | URLSession | Download task| didWriteData not calling when user switch between apps and come
- How to configure URLSessionConfiguration so that cached data lasts only 5 minutes (Backend doesn't handle expiration time)
- Add additional headers to Alamofire Session
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
So basically timeoutIntervalForRequest won't work in Background session but timeoutIntervalForResource will.
I got this answer from one of the members of Apple Staff at the developer forum. Also, I have verified this by implementing.