nsurlerrordomain

NSURLSession with background configuration and app killed by user

时间秒杀一切 提交于 2021-01-29 02:35:57
问题 This is the scenario: NSURLSession with background Configuration Download or upload task start with Bad or No Internet Connection. User close the App. If iOS get Internet Connection will star session task. However, With task still waiting for Internet. User kills the App System cancel all pending tasks The Question It is possible to know when the user opens the app again that the tasks were cancelled? If yes, where? This Answer says yes, it is possible, but I can not get any callback

NSURLErrorDomain Code=-1001 error when a http post request is sent

你离开我真会死。 提交于 2019-12-30 17:16:30
问题 I am using the following code to post an image to my server. @IBAction func postButtonPressed(sender: UIButton) { let task = NSURLSession.sharedSession().dataTaskWithRequest(createRequest("http://xx.xx.xxx.xxx/xxxx/"), completionHandler: { data, response, error in println(NSString(data: data, encoding: NSUTF8StringEncoding)) }) task.resume() } where createRequest() creates the required NSURLRequest object. This works fine when I use a simulator . The problem is that I am getting the following

Are NSURLErrorDomain error messages supposed to appear in the Xcode console?

会有一股神秘感。 提交于 2019-12-24 10:02:50
问题 When testing my app with connectivity turned off (wifi and cellular off), I am able to catch the error. But, in the Xcode console, I can also see the error messages. My code is not printing these to the console. Are these supposed to appear? Can I ignore them? Task .<1> HTTP load failed (error code: -1009 [1:50]) 2019-07-10 23:33:42.953046-0700 CodeSample[7157:942572] Task .<1> finished with error - code: -1009 The error codes are picked up here: `let task = session.dataTask(with: request,

Error Domain=NSURLErrorDomain Code=-1004 instead of -1009 in Swift service calls

↘锁芯ラ 提交于 2019-12-23 02:38:12
问题 Generally, while performing GET or POST calls in iOS using dataTaskWithRequest or sendAsynchronousRequest we use to face network related errors with error codes like, NSURLErrorNotConnectedToInternet = -1009 NSURLErrorCannotConnectToHost = -1004 NSURLErrorTimedOut = -1001 In my case i'm disconnecting the internet and performing service calls. So, the expected error code is "NSURLErrorNotConnectedToInternet = -1009" . But, its throwing "NSURLErrorCannotConnectToHost = -1004" like below, Error

Upload NSURLSesssion becomes invalidated in sharing extension in ios8 with error NSURLErrorDomain Code=-995

有些话、适合烂在心里 提交于 2019-12-09 05:27:53
问题 I try to upload an image using NSURLSession in shared extension in iOS 8 but have this error instantly after calling [task resume] Error Domain=NSURLErrorDomain Code=-995 "The operation couldn’t be completed. (NSURLErrorDomain error -995.)" here is my code: NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:DEFAULT_SHARE_SESSION_ID]; NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration delegate:self

NSURLErrorDomain error -1021

风格不统一 提交于 2019-12-09 01:53:56
问题 I'm developing an app were I integrated dropbox. Login is done properly also I'm able to create folder in dropBox. But when I try to load file I'm getting error Following error I'm getting error making request to /1/files_put/dropbox/Info.plist - Error Domain=NSURLErrorDomain Code=-1021 "The operation couldn’t be completed. (NSURLErrorDomain error -1021.)" UserInfo=0x6859bc0 {destinationPath=/Info.plist, sourcePath=/Users/bcod/Library/Application Support/iPhone Simulator/5.0/Applications

iOS Twitter NSURLErrorDomain Code=-1012

放肆的年华 提交于 2019-12-08 16:41:25
问题 I am trying to get the user's contact details by singning up with twitter in my app. I found this project on github which seems really good. I encounter only one problem. If I run it with my new app consumer secret and consumer key codes from twitter it gives me an error : Error Domain=NSURLErrorDomain Code=-1012 "The operation couldn’t be completed. (NSURLErrorDomain error -1012.)" UserInfo=0x6898e80 {NSErrorFailingURLKey=https://api.twitter.com/oauth/request_token,

NSURLConnection Error code (-1202,1012)

别说谁变了你拦得住时间么 提交于 2019-12-06 16:09:11
问题 I am using NSURLConnection for one field service type iOS appliation, so app is field service type there are more then 50 users and more then 50 users may use the application on same time that's why there are more then 50 or 60 request come to the server. Now my issue is I have received below two errors frequently means every single user can face this error more then 5 times in one day. so it become a challenge for me. The Error Code: -1202 NSURLErrorServerCertificateUntrusted -1012

NSURLConnection Error code (-1202,1012)

强颜欢笑 提交于 2019-12-04 22:24:23
I am using NSURLConnection for one field service type iOS appliation, so app is field service type there are more then 50 users and more then 50 users may use the application on same time that's why there are more then 50 or 60 request come to the server. Now my issue is I have received below two errors frequently means every single user can face this error more then 5 times in one day. so it become a challenge for me. The Error Code: -1202 NSURLErrorServerCertificateUntrusted -1012 NSURLErrorUserCancelledAuthentication I have searched a lot and i found that they are server related errors but

Upload NSURLSesssion becomes invalidated in sharing extension in ios8 with error NSURLErrorDomain Code=-995

安稳与你 提交于 2019-12-03 05:47:05
I try to upload an image using NSURLSession in shared extension in iOS 8 but have this error instantly after calling [task resume] Error Domain=NSURLErrorDomain Code=-995 "The operation couldn’t be completed. (NSURLErrorDomain error -995.)" here is my code: NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:DEFAULT_SHARE_SESSION_ID]; NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration delegate:self delegateQueue:self.queue]; NSURLRequest *request = [self getMultipartUploadRequest:data url:url albumId