2
votes
  1. When I’m uploading a build to AppStoreConnect (to test it via
    TestFlight for example), I’m getting the well-known deprecation
    message:

    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).

What I did: 1) Remove ios platform and added V5.1.0 ios platform.

2) Added below in config.xml

3) Ran ionic cordova build ios

List of cordova plugins I’m using:

cordova-plugin-add-swift-support 2.0.2 "AddSwiftSupport"

cordova-plugin-camera 4.1.0 "Camera"

cordova-plugin-chooser 1.2.6 "Chooser"

cordova-plugin-contacts 3.0.1 "Contacts"

cordova-plugin-device 2.0.2 "Device"

cordova-plugin-file 6.0.2 "File"

cordova-plugin-file-transfer 1.7.1 "File Transfer"

cordova-plugin-filepath 1.5.8 "cordova-plugin-filepath"

cordova-plugin-googleplus 5.2.1 "Google SignIn"   

cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard" 

cordova-plugin-ionic-webview 4.2.1 "cordova-plugin-ionic-webview"   

cordova-plugin-media-capture 3.0.3 "Capture"   

cordova-plugin-splashscreen 5.0.2 "Splashscreen"   

cordova-plugin-statusbar 2.4.2 "StatusBar" 

cordova-plugin-stripe 1.5.3 "cordova-plugin-stripe" 

cordova-plugin-telerik-imagepicker 2.3.3 "ImagePicker" 

cordova-plugin-video-editor 1.1.3 "VideoEditor" 

cordova-plugin-whitelist 1.3.3 "Whitelist" 

ionic-plugin-deeplinks 1.0.20 "Ionic Deeplink Plugin"

Ionic Info: Ionic: ionic (Ionic CLI) : 4.10.3 (/usr/local/lib/node_modules/ionic) Ionic Framework : enter code here ionic-angular 3.9.9 @ionic/app-scripts : 3.2.4

       Cordova:
      cordova (Cordova CLI) : 8.1.2 ([email protected])    

Cordova

Platforms : ios 5.1.0

Cordova Plugins :
cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 17 other plugins)

System: ios-deploy : 1.9.4 ios-sim : 8.0.2

NodeJS : v10.15.1 (/usr/local/bin/node)
npm : 6.4.1

OS : macOS Mojave

Xcode : Xcode 11.3.1 Build version 11C504

Does anybody have an idea what could cause the issue?

Thank you so much in advance!

3
Facing the same problem. I've uninstalled all 3rd party libraries, updated all native ionic libraries, and followed all the steps in their blog post to use WKWebView with no luck. It seems there are a lot of others with the same problem. Have you opened a ticket with ionic?pedrum golriz
Yes, Created ticket on the ionic forum but it's under review.Bhavesh
Turns out for me that admob uses UIwebview. Everybody is waiting on an update from them. Use this command to find out where its being used: grep -r "UIWebView" .pedrum golriz
Show in-app-browser and google-plus plugin. So what i have to do.Bhavesh
I have updated google plus plugin v8.4.0 but when Ifatal error 'googlesignin/googlesignin.h' file not found #import googlesignin/googlesignin.h build the app its return below error:Bhavesh

3 Answers

1
votes

As they said in Understanding ITMS-90809: UIWebView API Deprecation:

  • Add cordova plugin add cordova-plugin-ionic-webview@latest
  • Check all of your plugins. Update used (for example InAppBrowser 3.2.0) or remove unused plugins.

Also, use Cordova iOS 5.1.1

The most notable fix in this patch release was to make the prepare step to wait for the platform add step to finish. This resolved the bug that was seen when setting the WKWebViewOnly flag before adding the platform.

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

In config.xml add:

<platform name="ios">
    <preference name="WKWebViewOnly" value="true" />

    <feature name="CDVWKWebViewEngine">
        <param name="ios-package" value="CDVWKWebViewEngine" />
    </feature>

    <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
</platform>

More about this you can find in the article How To Use 'WKWebViewOnly'.

The above example uses the cordova-plugin-wkwebview-engine plugin:

  • Add plugin cordova-plugin-wkwebview-engine, preferably the latest version 1.2.1
  • Add preference attribute CordovaWebViewEngine to the config.xml
  • Add feature attribute CDVWKWebViewEngine to the config.xml
  • Add preference WKWebViewOnly to the config.xml

And last but not least:

 ionic cordova prepare ios

I hope this helps. I've followed these steps and didn't have any problems with an update to the App Store.

0
votes

Check the CordovaLib target -> Build Stettings -> User Defined (very bottom) of your project. There you find WK_WEB_VIEW_ONLY = 0 set this to WK_WEB_VIEW_ONLY = 1 Setting the macro via GCC_PREPROCESSOR_DEFINITIONS does not work. You can also search for WK_WEB_VIEW_ONLY with Xcode and it will display quickly if the Flag is set to 0.

This flag will be changed by Cordova only if the configure.xml contains <preference name="WKWebViewOnly" value="true" /> at the time you create a new ios project. So changing it manually in XCode to 1 in addition to adding the preference makes sense.

0
votes

With latest update apple removed UIWebView usage so app submitted with this UIWebView will be rejected, they want app to be build using WKWebView for improved security and reliability.

NOTE : If you some how added this plugin "cordova-plugin-wkwebview-engine" and ran "npm i cordova-plugin-wkwebview-engine" kindly undo these steps i.e (Remove plugin and npm uninstall it). As this will fail the build ios step with error 65.

To achieve this in our existing project we need to follow these steps in sequence so that our app gets deployed in App Store.

1). ionic cordova platform remove ios

2). ionic cordova plugin remove cordova-plugin-ionic-webview

3). ionic cordova plugin add cordova-plugin-ionic-webview@latest

4). npm install @ionic-native/ionic-webview@latest

5). Add following XML code in config.xml file under platform ios
        // These preferences and feature will automatically replace UIWebView to WKWebView in all the places of code during compile time.
        <preference name="WKWebViewOnly" value="true" />
        <feature name="CDVWKWebViewEngine">
            <param name="ios-package" value="CDVWKWebViewEngine" />
        </feature>
        <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />

6). Check in package.json file under dependencies key "cordova-ios": "5.1.1" should exist, if not exist then add "cordova-ios": "5.1.1"

7). ionic cordova platform add ios

8). ionic cordova prepare ios

9). ionic cordova build ios

Now these steps will successfully build the ios App and will be ready for deployment.

NOTE: I tested these steps in ionic 3 and ionic 4.

Hope this will help you or somebody else!

Thanks!