Posts

Post marked as solved
15 Replies
11k Views
I read here that when using `URLSessionConfiguration.background(withIdentifier:)`, it shouldn't timeout and should try again 'till there is an available internet connection or 'till `timeoutIntervalForResource` reached out (which is set to 7 days), but in this case, I'm getting the timeout after less than 15 seconds and after that it doesn't seems to try again, also when there is an internet connection (e.g. turning off Network Link Conditioner).I haven't set anything to that time so I really don't know why this is happening, all I've done is to set `100% Loss` in Network Link Conditioner to check offline usage (which shouldn’t matter to URLSession since it using background configuration).In short:My goal is to start the session whenever there is or there isn't an internet connection and let it fetch as soon as it can, when there is an available internet connection.What happens right now is that the session is timed out and not performing the session also when there is an internet connection (e.g. turning off Network Link Conditioner).*It's important to note that when there is an available internet connection while the session is resumed, it does fetching successfully, so the issue is not with the server I'm sending the task to for sure.Here is my code:Defining session configuration:static let urlSessionConfiguration: URLSessionConfiguration = { let configuration = URLSessionConfiguration.background(withIdentifier: FilesManager.urlSessionIdentifier) configuration.sessionSendsLaunchEvents = false configuration.sharedContainerIdentifier = "myApp" return configuration }()Starting the session:let url = URL(string: "https://url.com/path")! var urlRequest = URLRequest(url: url) urlRequest.httpMethod = "POST" urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") urlRequest.httpBody = body URLSession(configuration: FilesManager.urlSessionConfiguration, delegate: self, delegateQueue: nil).dataTask(with: urlRequest).resume()Delegate:extension FilesManager: URLSessionDataDelegate, URLSessionDelegate { func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { print("\(#function) \(error)") } }Print in console:urlSession(_:task:didCompleteWithError:) Optional(Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=-2104, _NSURLErrorFailingURLSessionTaskErrorKey=BackgroundDataTask .<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "BackgroundDataTask .<1>", "LocalDataTask .<1>" ), NSLocalizedDescription=The request timed out., _kCFStreamErrorDomainKey=4, NSErrorFailingURLStringKey=https://url.com/path, NSErrorFailingURLKey=https://url.com/path})If you know a better way to achieve my goal or you’re think there is something wrong in this code, please, let me know.Thanks,Ido.
Posted
by idomo.
Last updated
.
Post not yet marked as solved
6 Replies
4.4k Views
Having this issue since beta 3 came out and hoped that beta 4 will fix this, but it didn't.Every time I'm opening Main.storyboard in xCode, I'm getting the death wheel (colorful endless spinning wheel) with the error "An internal error has occurred editing functionality may be limited".The only option I have is to "Quit immediately", but when opening xCode again, it loads the storyboard since is the last file I've opened, so the only way to be able to use xCode at all is to go to the project directory, right click on the .xcworkspace file, click "Show package contents", locate the file "UserInterfaceState.xcuserstate" and delete it.Only after deleting this file I'm able to use xCode as normal as possible and of course, the storyboard is still not accessible.Well, I've reported to Apple via the Feedback Assistant and via the email and also updated them that it happens also in beta 4, but it doesn't seems like anyone cares about it.It doesn't seems to happen with any other storyboard file from other projects and the launch screen file, it's only in this specific file, but the exact same file (without any changes) was working perfectly with xCode beta 2.Also, since this issue has begun, some specific ViewController's localization stopped working(?), it's just showing this specific one in English (base) translation while the whole app is showen in anouther language (the device's/simulator's main language, it happen on both iOS 12 & 13), maybe it's related some how? 😕* Tried everything from restart the Mac to deleting Derived Data (several times), went all over google (this forum, stackoverflow and some more places) - nothing helps.This is the closest description to my issue, that of course, doesn’t have any helpful answer.* The app is running fine on real device/simulator with iOS 12/13 (respectively).*I have xCode 10.2.1 installed, but can't open the project or the storyboard there 'cause I've adopt iOS 13 color scheme that doesn't supports there.* Using macOS 10.14.4 (18E226)Any suggestions? I'll really appreciate any kind of help.The storyboard file (remove the spaces around "google"):drive. google .com/file/d/10ynwU7mtTIUE8pW2Ud4dHtSAzJTv5vEc/view
Posted
by idomo.
Last updated
.
Post not yet marked as solved
3 Replies
2.2k Views
Having this issue since beta 3 came out and hoped that beta 4 will fix this, but it didn't.Every time I'm opening Main.storyboard in xCode, I'm getting the death wheel (colorful endless spinning wheel) with the error "An internal error has occurred editing functionality may be limited".The only option I have is to "Quit immediately", but when opening xCode again, it loads the storyboard since is the last file I've opened, so the only way to be able to use xCode at all is to go to the project directory, right click on the .xcworkspace file, click "Show package contents", locate the file "UserInterfaceState.xcuserstate" and delete it.Only after deleting this file I'm able to use xCode as normal as possible and of course, the storyboard is still not accessible.Well, I've reported to Apple via the Feedback Assistant and via the email and also updated them that it happens also in beta 4, but it doesn't seems like anyone cares about it.It doesn't seems to happen with any other storyboard file from other projects and the launch screen file, it's only in this specific file, but the exact same file (without any changes) was working perfectly with xCode beta 2.Also, since this issue has begun, some specific ViewController's localization stopped working(?), it's just showing this specific one in English (base) translation while the whole app is showen in anouther language (the device's/simulator's main language, it happen on both iOS 12 & 13), maybe it's related some how? 😕* Tried everything from restart the Mac to deleting Derived Data (several times), went all over google (this forum, stackoverflow and some more places) - nothing helps.This is the closest description to my issue, that of course, doesn’t have any helpful answer.* The app is running fine on real device/simulator with iOS 12/13 (respectively).*I have xCode 10.2.1 installed, but can't open the project or the storyboard there 'cause I've adopt iOS 13 color scheme that doesn't supports there.* Using macOS 10.14.4 (18E226)Any suggestions? I'll really appreciate any kind of help.The storyboard file (remove the spaces around "google"):drive. google .com/file/d/10ynwU7mtTIUE8pW2Ud4dHtSAzJTv5vEc/view
Posted
by idomo.
Last updated
.