adamhartford / SwiftR

Swift client for SignalR (iOS and Mac)
MIT License
174 stars 74 forks source link

UIWebView deprecated #136

Open NeedNap opened 4 years ago

NeedNap commented 4 years ago

I'm using the WKWebView component version of the library, but when I deploy the app to the Apple Store I get the following error: ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview).

How can I remove all UIWebView references from the library? Thank you

georgenimber commented 4 years ago

There are version available if you search without UIWebView. But using these , I can't connect as I get negotiation issue. Not sure what needs to change in the server side. Any ideas?

NeedNap commented 4 years ago

I managed to get it working by changing the library code by removing all references to the UIWebView object

TahirTahir commented 4 years ago

Hi @NeedNap I am going through similar problem, and i can't seem to remove references to the UIWebView. Can you please share your code? Thank you

NeedNap commented 4 years ago

This is my fixed code SwiftR.zip

;)

TahirTahir commented 4 years ago

Thanks A lot. For some reason the code was not working, maybe commenting UIWebView messes up with some features. I had to convert UIWebView to WKWebview everywhere.

NeedNap commented 4 years ago

It's very strange: the code I posted works very well for me (I already removed all UIWebView references) but I don't use the useWKWebView flag to true because my SignalR is not the .NET Core version.

andyarus commented 3 years ago

config.setValue(true, forKey: "allowUniversalAccessFromFileURLs")

Screenshot 2020-11-26 at 05 50 03

tayalva commented 3 years ago

has anyone else had trouble with WKWebView not connecting properly/timing out after 40 seconds or so? UIWebView works great, WKWebView seems to have connection issues

Ali-El commented 2 years ago

I have discovered that using @NeedNap solution (downloaded the .zip you shared, thanks a million btw) works. I have a .Net self-hosted server running in windows 10 coded in VB.net. At first, the connection wasn't being established, I thought it was the client at the fault - which is an iOS app using swift and UIKit, and after hours of researching turns out if your server is on your local network then use the local IP address of the machine running the server instead of the global IP. Also, make sure all your ports are accessible. My issue was the device being on the same wifi as the server had to communicate on a local IP, and when I turned off the wifi on the test device then I had to switch back to the global IP. I hope this helps ✊🏾