Capacitor: bug: ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability

Created on 7 May 2020  路  9Comments  路  Source: ionic-team/capacitor

Bug Report

TMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability

Getting this repeated error when trying to build and upload to ios apple connect service in order to test with test flight. I am also using inappbrowser from cordova in order to authenticate with azure AD. I have attempted to enforce usewkwebview=yes but whenever I do this the browser will not open at all.

However, even if I remove this package and remove the auth code, I still get the same error email from Apple stating that my app is using UIWebView. So I don't think this is the culprit, or atleast not the only one!

Please help!

Capacitor Version

npx cap doctor output:
`馃拪 Capacitor Doctor 馃拪

Latest Dependencies:

@capacitor/cli: 2.0.2

@capacitor/core: 2.0.2

@capacitor/android: 2.0.2

@capacitor/electron: 2.0.2

@capacitor/ios: 2.0.2

Installed Dependencies:

@capacitor/electron not installed

@capacitor/cli 2.0.2

@capacitor/ios 2.0.2

@capacitor/core 2.0.2

@capacitor/android 2.0.2

[success] Android looking great! 馃憣
Found 3 Capacitor plugins for ios:
cordova-plugin-camera (4.1.0)
cordova-plugin-inappbrowser (3.2.0)
cordova-plugin-video-editor (1.1.3)
[success] iOS looking great! 馃憣`

Affected Platform(s)

  • [ ] Android
  • [x] iOS
  • [ ] Electron
  • [ ] Web

npm --version output: 6.4.1

node --version output: v10.15.0

pod --version output (iOS issues only): 1.9.1

Most helpful comment

The problem is cordova-plugin-inappbrowser, it still has UIWebView code.

In cordova apps you can conditionally "hide" it by using the WKWebViewOnly preference. What that preference does is to add a WK_WEB_VIEW_ONLY=1 preprocessor macro in the project so parts of the plugin code is not compiled, but the preference doesn't work in Capacitor, so you have to add the preprocessor manually.

Or update to Capacitor 2.1.0, as we have added that preprocessor to the CordovaPlugins pod, so if any plugin relies on that being set it will just work for them now.

You can also use the dev version of cordova-plugin-inappbrowser as all the UIWebView code was removed, just has not been released yet.

All 9 comments

The problem is cordova-plugin-inappbrowser, it still has UIWebView code.

In cordova apps you can conditionally "hide" it by using the WKWebViewOnly preference. What that preference does is to add a WK_WEB_VIEW_ONLY=1 preprocessor macro in the project so parts of the plugin code is not compiled, but the preference doesn't work in Capacitor, so you have to add the preprocessor manually.

Or update to Capacitor 2.1.0, as we have added that preprocessor to the CordovaPlugins pod, so if any plugin relies on that being set it will just work for them now.

You can also use the dev version of cordova-plugin-inappbrowser as all the UIWebView code was removed, just has not been released yet.

@jcesarmobile could you point out the dev branch for cordova-plugin-inappbrowser

There is no dev branch, it鈥檚 master

I upgraded to Capacitor 2.1.0 and still get rejected for the same reason "ITMS-90809: Deprecated API Usage". Also, App Store Connect requires the push notification capability since push notifications are built into Capacitor. Also, Capacitor 2.1.0 has peer dependencies of ~2.0.0 @jcesarmobile

@jcesarmobile I already built on their #master branch but I still got rejected with the following message

We identified one or more issues with a recent delivery for your app, "APP NAME" 1.0.0 (2.0.0). Please correct the following issues, then upload again.

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

Best regards

It鈥檚 not just inappbrowser, there are a lot of plugins that have the problem, for the OP it was inappbrowser, but you could have more.
But it鈥檚 not capacitor, so, please, don't use github issues to ask this kind of questions, for questions you can ask on the forum, slack or stack overflow using capacitor tag.

Did not work.
Make a simple app with the following:
These are my steps detailed:

cd Desarrollo/Workspace_Xcode/
sudo cordova create MyApp com.mybusiness.app1 ExampleApp
cd MyApp
sudo cordova platform add ios
sudo cordova plugin add cordova-plugin-device
sudo cordova plugin add cordova-plugin-dialogs
sudo cordova plugin add cordova-plugin-inappbrowser
sudo cordova plugin add cordova-plugin-wkwebview-engine
cd ..
sudo chown -R myuser MyApp

Open Xcode workspace, add in config.xml


Added info.plist

Then
sudo cordova platform rm ios
sudo cordova platform add iOS

sudo cordova plugin list
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-dialogs 2.0.2 "Notification"
cordova-plugin-inappbrowser 3.2.0 "InAppBrowser"
cordova-plugin-whitelist 1.3.4 "Whitelist"
cordova-plugin-wkwebview-engine 1.2.1 "Cordova WKWebView Engine"

Run the app, it shows the usual apache device ready, upload to appstore and validate is ok, my app rejected from apple:

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

We have cli version 9.0.0 ([email protected])
Cordova 5.1.1
Xcode 11.5
iOS 10.15.5 (catalina)
xcodebuild -showsdks
iOS SDKs:
iOS 13.5 -sdk iphoneos13.5
iOS Simulator SDKs:
Simulator - iOS 13.5 -sdk iphonesimulator13.5
macOS SDKs:
DriverKit 19.0 -sdk driverkit.macosx19.0
macOS 10.15 -sdk macosx10.15
tvOS SDKs:
tvOS 13.4 -sdk appletvos13.4
tvOS Simulator SDKs:
Simulator - tvOS 13.4 -sdk appletvsimulator13.4
watchOS SDKs:
watchOS 6.2 -sdk watchos6.2
watchOS Simulator SDKs:
Simulator - watchOS 6.2 -sdk watchsimulator6.2

@surbituy having the same issue... were you able to make any progress? and to anyone, would migrating over to capacitor solve the issue?

Yes, this solved my problem:
cordova plugin add https://github.com/apache/cordova-plugin-device.git
cordova plugin add https://github.com/apache/cordova-plugin-dialogs.git
cordova plugin add https://github.com/apache/cordova-plugin-inappbrowser.git
cordova platform add https://github.com/apache/cordova-ios.git

This is the only way to remove UIWebView references.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nicobytes picture nicobytes  路  3Comments

danielsogl picture danielsogl  路  3Comments

natevw picture natevw  路  3Comments

MatanYadaev picture MatanYadaev  路  3Comments

alexcroox picture alexcroox  路  3Comments