Posts

Post not yet marked as solved
5 Replies
519 Views
Hello, I'm having an unusual problem dealing with web sockets from Swift. I adopted the URLSessionWebSocketDelegate for my session extension and there are times when after the webSocketTask:didOpenWithProtocol: method is called that I then get errors indicating that the web socket is not connected. This all happens in the foreground with airplane mode off, without putting my app in the background. I get the connection errors simultaneously in 2 places: urlSession(_ session:task: didCompleteWithError error: ) webSocketTask?.receive(completionHandler: @escaping (Result<URLSessionWebSocketTask.Message, Error>) Forgive me as I have 2 rather ****** questions: Is the web socket open state the same as the web socket's connected state? If it isn't the same how do I know if a web socket is connected, using Apple's URLSessionTask extension? Thanks. I'd rather stick with Apple's implementation and not use a third party web socket library. Pretty sure the error is mine.
Posted
by salCat.
Last updated
.
Post not yet marked as solved
2 Replies
516 Views
Greetings, I have an app that relies on WKWebView and it works fine in iOS 15.1. However I've noticed that the WKWebView hangs in all the iOS 15.2 betas after approximately 20 seconds. At this point my only recourse is to recreate the WKWebView, as it no longer accepts any javascript. The remainder of the app behaves normally. Has anyone else experienced this and have any suggestions? My app updates the WKWebview approximately every second. However even without updating it, interacting with javascript running on it also causes it to lock up. Hitting the pause button on Xcode reveals that the JavaScriptCode malloc scavenger's last instruction is 0_psynch_cwait, but then again pausing the app when the WKWebView is not hanging reveals the same so, it's not a good clue. Thank you, SalCat
Posted
by salCat.
Last updated
.