SwiftR icon indicating copy to clipboard operation
SwiftR copied to clipboard

UIWebView deprecated

Open NeedNap opened this issue 4 years ago • 9 comments

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

NeedNap avatar May 15 '20 07:05 NeedNap

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?

georgenimber avatar May 15 '20 13:05 georgenimber

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

NeedNap avatar May 15 '20 13:05 NeedNap

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

TahirTahir avatar Jul 08 '20 06:07 TahirTahir

This is my fixed code SwiftR.zip

;)

NeedNap avatar Jul 08 '20 12:07 NeedNap

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.

TahirTahir avatar Jul 11 '20 11:07 TahirTahir

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.

NeedNap avatar Jul 11 '20 16:07 NeedNap

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

Screenshot 2020-11-26 at 05 50 03

andyarus avatar Nov 26 '20 00:11 andyarus

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

tayalva avatar Mar 17 '21 17:03 tayalva

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 ✊🏾

Ali-El avatar Feb 19 '22 21:02 Ali-El