How to fix UIWebView deprecated Ionic 4
Asked Answered
P

8

5

When submitting my latest build, Apple suddenly returned a message saying that there was an issue, specifically:

ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs. See https://developer.apple.com/documentation/uikit/uiwebview for more information. What that means and are that related to using the IONIC framework. How to fix it.

Pallaten answered 11/9, 2019 at 8:48 Comment(0)
B
15

The cordova team yesterday released 2019-11-25 a release [email protected]

This release resolves the ITMS-90809 alert from the apple store.

cordova platform remove ios
cordova platform add [email protected]

Add <preference name = "WKWebViewOnly" value = "true" /> to your config.xml file

Run "cordova prepare ios" to apply the changes.

https://cordova.apache.org/announcements/2019/11/25/cordova-ios-release-5.1.0.html#comment-4702612854

Broads answered 26/11, 2019 at 12:54 Comment(0)
A
3

Use cordova-ios version 5.1.0 or above. if you are using facebook4, googleplus, fcm and inappbrowser plugins then upgrade them to latest versions. It is not mandatory to migrate to Capacitor.

add this to your config.xml file

<preference name="WKWebViewOnly" value="true" />
Alverson answered 11/9, 2020 at 11:41 Comment(0)
T
2

First remove cordova ios

cordova platform remove ios

Add cordova for ios

cordova platform add [email protected]

Ensure you have a WKWebView plugin installed: if not add by using following command.

cordova plugin add cordova-plugin-ionic-webview@latest

Add following to the config.xml file.

<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
<preference name="WKWebViewOnly" value="true" /> 

Run cordova prepare ios to apply the changes.

cordova prepare ios
Taken answered 14/5, 2020 at 14:0 Comment(2)
I also updated ALL cordova plugins and it worked !!!Teeny
Hi may I know where to do the last step "set webkitframework to required in Xcode"?Unsteel
S
0

This is currently a problem with the Ionic framework, you can follow the ongoing discussion at the official forums.

Ionic team claims that this warning can be ignored but there are concerns that Apple might indeed reject Apps built with Ionic although no case is known (yet). The suggested solution is using Capacitor instead of Cordova but depending on your usage of Cordova plugins this may not be an option.

Schuss answered 11/9, 2019 at 8:55 Comment(0)
F
0

Just try use ionic capacitor Capacitor

or update UIWebView to WKWebView

rm platform ios & android

update and install WKwebView ionic cordova plugin add cordova-plugin-ionic-webview --save https://ionicframework.com/docs/v3/wkwebview/

Faria answered 11/9, 2019 at 8:57 Comment(1)
The OP is using Ionic 4 which has always used WKWebView. Also using Capacitor may not be an option if his plugins are not supported.Schuss
G
0

Just try use ionic capacitor Capacitor

https://capacitor.ionicframework.com/

we finally shiftted cordova to capacitor and make it my app

Grueling answered 3/10, 2019 at 14:33 Comment(0)
S
0

It's not possible right now using cordova, even though using wkwebview there are some references in the code to the uiwebview, so you will have to wait cordova take care of this, see this issue for more details: https://github.com/apache/cordova-ios/issues/661

Straticulate answered 4/10, 2019 at 22:58 Comment(0)
A
0

1- make sure that you have updated all othe plugin you use to the latest version . For example using an old version of cordova-plugin-inappbrowser can cause such problem

2- install V6+ of cordova ios

 ionic cordova platform rm ios 
 ionic cordova platform add [email protected]

I strongly suggest that you perform intensive smoke tests after upgrading .

Also I would consider migrating to Capacitor, although it does not fulfill all my needs ATM.

Alviani answered 24/6, 2020 at 21:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.