Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIWebview Depreciation warning still occurs with Cordova-iOS 5.1.1 #745

Closed
Jeevan2019 opened this issue Dec 17, 2019 · 35 comments
Closed

UIWebview Depreciation warning still occurs with Cordova-iOS 5.1.1 #745

Jeevan2019 opened this issue Dec 17, 2019 · 35 comments
Labels

Comments

@Jeevan2019
Copy link

Jeevan2019 commented Dec 17, 2019

Bug Report

Problem

We have updated the Cordova iOS library to the latest version 5.1.1 and the tag < preference name="WKWebViewOnly" value="true" / > was added to the config.xml. We have published the app to check whether the UIWebView depreciation doesn't occur again but the warning still appears. We have certain customers for whom we publish the apps. So when they receive this warning they are questioning us about it. Please let us know when will the updated Cordova ios version will be released with all UIWebview references removed.

What is expected to happen?

As per information in #715 the warning should not appear after setting WKWebViewOnly flag to true in config.xml

What does actually happen?

The below warning from Apple still appears.

We identified one or more issues with a recent delivery for your app, "Sample Test" 4.0.0 (4.0.1). Your delivery was successful, but you may wish to correct the following issues in your next delivery:

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.
After you’ve corrected the issues, you can upload a new binary to App Store Connect.

Command or Code

Environment, Platform, Device

iOS

Version information

Cordova CLI version: 9.0.0
Cordova iOS version: 5.1.1
XCode version: 10.1
OS: Mac OS High Sierra

Checklist

  • [ x] I searched for existing GitHub issues
  • [ x ] I updated all Cordova tooling to most recent version
  • [ x ] I included all the necessary information above
@breautek
Copy link
Contributor

Can you provide us the list of plugins you are using?

cordova plugin list

@breautek breautek transferred this issue from apache/cordova Dec 17, 2019
@breautek breautek added info-needed Further information is requested support labels Dec 17, 2019
@Jeevan2019
Copy link
Author

cordova-plugin-camera 4.1.0 "Camera"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-file 6.0.2 "File"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-whitelist 1.3.4 "Whitelist"
cordova-plugin-wkwebview-engine 1.2.1 "Cordova WKWebView Engine"

@jcesarmobile
Copy link
Member

jcesarmobile commented Dec 18, 2019

What do you mean by

and tag was added to the config.xml

?

@Jeevan2019
Copy link
Author

What do you mean by

and tag was added to the config.xml

?

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

We have added the above preference tag in the config.xml file.

@abhinavkumar-utsa
Copy link

hello @breautek , I'm facing the same issue. Was wondering if there was something in addition to
< preference name="WKWebViewOnly" value="true" / >
to not have UIWebview make it into the build that Apple reviews.

@breautek
Copy link
Contributor

There shouldn't need to do anything other than adding the preference and rebuilding, while using [email protected]

There are some known plugins such as the inappbrowser that still references the deprecated APIs and therefore trigger the apple warning. So if you have any plugins that uses the UIWebVIew apis, those plugins needs to be updated as well. Currently at the time of writing, there is no updates for the inappbrowser, but there are pending PRs.

You can try to remove/re-add the cordova platform, or try to use cordova prepare ios, but that shouldn't be necessary.

@breautek breautek removed the info-needed Further information is requested label Dec 19, 2019
@Jeevan2019
Copy link
Author

There shouldn't need to do anything other than adding the preference and rebuilding, while using [email protected]

There are some known plugins such as the inappbrowser that still references the deprecated APIs and therefore trigger the apple warning. So if you have any plugins that uses the UIWebVIew apis, those plugins needs to be updated as well. Currently at the time of writing, there is no updates for the inappbrowser, but there are pending PRs.

You can try to remove/re-add the cordova platform, or try to use cordova prepare ios, but that shouldn't be necessary.

Hello @breautek. Thanks for your response.
We have created a new sample app by adding the cordova-ios platform of version 5.1.1. Also added the WKWebView plugin and < preference name="WKWebViewOnly" value="true" / > tag in config.xml. Published the app after doing 'cordova prepare ios', the same warning from apple appears again. Here is the plugin list:

cordova-plugin-whitelist 1.3.4 "Whitelist"
cordova-plugin-wkwebview-engine 1.2.1 "Cordova WKWebView Engine"

@breautek
Copy link
Contributor

Can you confirm that you have the following in your config.xml file

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

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

https://github.com/apache/cordova-plugin-wkwebview-engine#configxml

This should have been added to the config when the wkwebview plugin is installed, but please double check.

@Jeevan2019
Copy link
Author

Can you confirm that you have the following in your config.xml file

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

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

https://github.com/apache/cordova-plugin-wkwebview-engine#configxml

This should have been added to the config when the wkwebview plugin is installed, but please double check.

@breautek I can see all these tags in our config.xml.

@Jeevan2019
Copy link
Author

Attached file has the contents of our config.xml file

Config file.txt

@obryl
Copy link

obryl commented Dec 23, 2019

Facing the same issue. With adding <preference name="WKWebViewOnly" value="true"/> the warning for TestFlight build still exists.

@Jeevan2019
Copy link
Author

Jeevan2019 commented Dec 27, 2019

Please let us know if there are any updates on this issue.

@breautek
Copy link
Contributor

@Jeevan2019 Are you sure you supplied the full plugin list? I had a look at your config.xml, and the plugins listed doesn't explain why the following is added

<feature name="LocalStorage">
        <param name="ios-package" value="CDVLocalStorage" />
    </feature>
    <feature name="Console">
        <param name="ios-package" value="CDVLogger" />
        <param name="onload" value="true" />
    </feature>
    <feature name="HandleOpenUrl">
        <param name="ios-package" value="CDVHandleOpenURL" />
        <param name="onload" value="true" />
    </feature>
    <feature name="IntentAndNavigationFilter">
        <param name="ios-package" value="CDVIntentAndNavigationFilter" />
        <param name="onload" value="true" />
    </feature>
    <feature name="GestureHandler">
        <param name="ios-package" value="CDVGestureHandler" />
        <param name="onload" value="true" />
    </feature>

These would have been added by plugins but these features, I don't think would have came from any of your listed plugins.

If you are using a sample app to test this with, I would advise you to test without any plugins at all, other than the required wkwebview plugin of of course. If it works, then then that proves the issue lies somewheres outside of cordova-ios.

You can then add each plugin one at a time, and retest if you want to pinpoint exactly which plugin is the source. If the source is revealed then you can create a ticket in the appropriate place.

@erisu
Copy link
Member

erisu commented Dec 28, 2019

@breautek I think the config.xml file that is being shared is the file from: <project_name>/platforms/ios/<project_name>/config.xml, it is not their project config.xml.

The feature tags you are referencing above are defaults coming from cordova-ios and is defined here:

https://github.com/apache/cordova-ios/blob/master/bin/templates/scripts/cordova/defaults.xml

@breautek
Copy link
Contributor

@erisu that would explain my confusion. I was expecting <project root>/config.xml contents, not the platform one.

@Jeevan2019
Copy link
Author

Hi @breautek Please find the attached config.xml file
Config File2.txt

@Jeevan2019
Copy link
Author

@erisu that would explain my confusion. I was expecting <project root>/config.xml contents, not the platform one.

Do we need to add this tag <preference name="WKWebViewOnly" value="true"/> in both the config.xml files of the project? Please confirm.

@brodycj
Copy link

brodycj commented Dec 30, 2019

Whatever preferences you configure in config.xml in the project root should be automatically copied into config.xml in each platform whenever you do cordova platform add or cordova prepare. (Maybe the whole config.xml file is copied, I would have to research to confirm).

I suspect that Cordova would automatically copy this information whenever you do cordova build or cordova run, would have to research before I can confirm 100%.

You should never have to manually copy this preference information into the platform file. It is good to check it, though.

@erisu
Copy link
Member

erisu commented Dec 30, 2019

@Jeevan2019 you should add <preference name="WKWebViewOnly" value="true"/> to the <project_root>/config.xml. Try to only modify and manage your configs in this file.

It is not recommend to modify the <project_root>/platforms/ios/<project_name>/config.xml file directly. Since the file is generated and updated during prepare, there are always potential risks that things you add directly to this file will be removed.

@obryl
Copy link

obryl commented Jan 2, 2020

@Jeevan2019 has placing <preference name="WKWebViewOnly" value="true"/> into root config.xml solved your problem? For me it was always set from the root file, but have never worked :(

@Jeevan2019
Copy link
Author

@Jeevan2019 you should add <preference name="WKWebViewOnly" value="true"/> to the <project_root>/config.xml. Try to only modify and manage your configs in this file.

It is not recommend to modify the <project_root>/platforms/ios/<project_name>/config.xml file directly. Since the file is generated and updated during prepare, there are always potential risks that things you add directly to this file will be removed.

@erisu @obryl I have added the key <preference name="WKWebViewOnly" value="true"/> to the <project_root>/config.xml file and we didn't receive the apple warning now. Sine we have tried this on a sample app, we have to migrate our whole project to the new cordova-ios platform of version 5.1.1 and need to check if the issue still persists.

@Jeevan2019
Copy link
Author

Thank you guys for your support.

@obryl
Copy link

obryl commented Jan 3, 2020

Still doesn't work for me :(

Here is my plugins list, maybe you could advice me on what's wrong here:

    <plugin name="cordova-plugin-statusbar" spec="~2.4.2" />
    <plugin name="cordova-plugin-device" spec="~2.0.2" />
    <plugin name="cordova-plugin-splashscreen" spec="~5.0.2" />
    <plugin name="cordova-plugin-ionic-webview" spec="^4.0.0">
        <variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" />
    </plugin>
    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.1.3" />
    <plugin name="cordova-plugin-screen-orientation" spec="~3.0.2" />
    <plugin name="mx.ferreyra.callnumber" spec="^1.0.1" />
    <plugin name="uk.co.workingedge.phonegap.plugin.launchnavigator" spec="^5.0.4">
        <variable name="GOOGLE_API_KEY_FOR_ANDROID" value="AIzaSyBinwW0jA-QLDxHmcARrdkZoNCKM-kxGkg" />
        <variable name="OKHTTP_VERSION" value="3.12.0" />
    </plugin>
    <plugin name="cordova-ios-plugin-no-export-compliance" spec="~0.0.5" />
    <plugin name="com.testfairy.cordova-plugin" spec="~2.19.1" />
    <plugin name="cordova-plugin-camera" spec="~4.1.0" />
    <plugin name="cordova-plugin-ios-camera-permissions" spec="~1.2.0" />
    <plugin name="cordova-plugin-httpd" spec="^0.9.3" />

Thanks

@obryl
Copy link

obryl commented Jan 4, 2020

Got it fixed by removing file-releated plugins, which by some reason were not listed in config.xml

@breautek
Copy link
Contributor

breautek commented Jan 4, 2020

Got it fixed by removing file-releated plugins, which by some reason were not listed in config.xml

For future references, True source of plugin information is the package.json file as of cordova 9. Cordova still reads from config.xml for backwards compatibility but I don't think it writes to it now.

Alternatively, you can use cordova plugin list to list plugins as well.

@breautek
Copy link
Contributor

breautek commented Jan 4, 2020

@Jeevan2019 glad you found a potential solution. Please do let us know if this issue can be closed.

@rajashekaranugu
Copy link

rajashekaranugu commented Jan 8, 2020

Hi @breautek, I also got same warning email from apple just now can you please help me if I need to add/remove any plugins???.

I have used cordova-ios 5.1.1, ionicwebview 4.1.2 and inAppBrowser 3.2.0 (latest one modified to use WK instead of UIWebView) and below are the plugin list
call-number 0.0.2 "Cordova Call Number Plugin"
cordova-plugin-add-swift-support 2.0.2 "AddSwiftSupport"
cordova-plugin-advanced-http 2.1.1 "Advanced HTTP plugin"
cordova-plugin-aes256-encryption 1.2.2 "AES256"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-browsertab 0.2.0 "cordova-plugin-browsertab"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-file 6.0.2 "File"
cordova-plugin-file-opener2 2.2.1 "File Opener2"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-fingerprint-aio 2.0.0 "FingerprintAllInOne"
cordova-plugin-firebase 2.0.5 "Google Firebase Plugin"
cordova-plugin-google-analytics 1.8.6 "Google Universal Analytics Plugin"
cordova-plugin-inappbrowser 3.2.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-migrate-ios-storage 0.3.6 "cordova-plugin-ionic-migrate-ios-storage"
cordova-plugin-ionic-webview 4.1.2 "cordova-plugin-ionic-webview"
cordova-plugin-ios-keychain 3.0.1 "KeyChain Plugin for Cordova iOS"
cordova-plugin-nativestorage 2.3.2 "NativeStorage"
cordova-plugin-secure-storage 3.0.2 "SecureStorage"
cordova-plugin-splashscreen 5.0.3 "Splashscreen"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-touch-id 3.3.1 "Touch ID"
cordova-plugin-whitelist 1.3.4 "Whitelist"
cordova-support-google-services 1.3.1 "cordova-support-google-services"
phonegap-plugin-multidex 1.0.0 "Multidex"
phonegap-plugin-push 2.3.0 "PushPlugin"

IONIC INFO:
Ionic:

Ionic CLI : 5.4.4 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.10.0
@angular-devkit/build-angular : 0.803.21
@angular-devkit/schematics : 8.1.3
@angular/cli : 8.1.3
@ionic/angular-toolkit : 2.0.0

Cordova:

Cordova CLI : 9.0.0 ([email protected])
Cordova Platforms : ios 5.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-migrate-ios-storage 0.3.6, cordova-plugin-ionic-webview 4.1.2, (and 23 other plugins)

Utility:

cordova-res : 0.8.0 (update available: 0.8.1)
native-run : not installed

System:

ios-deploy : 1.9.4
NodeJS : v10.15.1 (/usr/local/lib/node_modules/node/bin/node)
npm : 6.4.1
OS : macOS Mojave
Xcode : Xcode 11.3 Build version 11C29

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

in config.xml (config file at project root)

Appriciate your help
Thanks
Raj

@Jeevan2019
Copy link
Author

@rajashekaranugu Did you tried after doing cordova prepare ios. Please let us know.

@erisu
Copy link
Member

erisu commented Jan 12, 2020

@Jeevan2019 Please close this issue if your problem has been resolved.

As for @rajashekaranugu, the problem you have is coming from the cordova-plugin-google-analytics plugin. You will probably need to remove this plugin as well as remove and add back the platform. Removing the plugin alone may not remove the framework from the platform. It has already been reported that cordova-plugin-google-analytics causes the deprecation warning here: #761

@18825607789
Copy link

I also got same warning email from apple just now can you please help me if I need to add/remove any plugins???.

I have used cordova-ios 5.1.1,

@tamvcspk
Copy link

tamvcspk commented Jan 13, 2020

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

I added them to <platform name="ios"> tag and it works
cordova-ios: 5.1.1
OS: MacOS Catalina 10.15.2
Node: v13.5.0
Xcode: Version 11.3 (11C29)

@rajashekaranugu
Copy link

rajashekaranugu commented Jan 13, 2020

@rajashekaranugu Did you tried after doing cordova prepare ios. Please let us know.

@Jeevan2019 we have replaced Firebase plugin with FirebaseX plugin, updated inapp browser from 3.1.0 to 3.2.0, by default our app was using ionic-webView 4.1.2 and cordova-ios 5.1.1. and added just the preference to use "WKWEBVIEW" To true.

Then with above changes we did not receive an email from apple.

The main change we did is we have migrated Firebase plugin to FirebaseX plugin.

To my understanding, Also I advice you to check ios.json under plugin folder. Most of the time when you build app with "ionic cordova build ios" should include all the settings and preferences mentioned in your root config file. if you have mentioned any more plugins in package.json which is not mentioned in root config.xml by running 'ionic cordova prepare ios' should add everything.

Please COMPARE ios.json and "ionic cordova plugin list"

@jcesarmobile
Copy link
Member

Going to close since this is fixed.

People having problems is because of plugins using UIWebView, usually because they are old and use old frameworks from google analytics, firebase, facebook, etc and since the usage is on the framework it won't appear on the code search, but it's there.

@amolchaware
Copy link

@breautek We have created an app by adding the cordova-ios platform of version 5.1.0. Also added the WKWebView plugin and tag in config.xml. Upload the app on app store after doing 'cordova prepare ios',
below are the plugin list
cordova-clipboard 1.2.1 "Clipboard"
cordova-plugin-bg-location-sender 1.0.0 "BGLocationSender"
cordova-plugin-camera 4.1.0 "Camera"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-facebook4 4.2.1 "Facebook Connect"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-google-analytics 1.8.6 "Google Universal Analytics Plugin"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.1.3 "cordova-plugin-ionic-webview"
cordova-plugin-network-information 2.0.2 "Network Information"
cordova-plugin-splashscreen 5.0.3 "Splashscreen"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-stripe 1.5.3 "cordova-plugin-stripe"
cordova-plugin-whitelist 1.3.4 "Whitelist"
cordova-plugin-x-socialsharing 5.6.4 "SocialSharing"
es6-promise-plugin 4.2.2 "Promise"
onesignal-cordova-plugin 2.4.7 "OneSignal Push Notifications"

But still I am getting the Deprecated warning.

@jcesarmobile
Copy link
Member

I’m locking the issue because it’s fixed. As I said, a lot of plugins need to be updated because their frameworks were using UIWebView, including Facebook, google analytics and a few others, you’ll have to figure out which one and report in the plugin repo.

@apache apache locked as resolved and limited conversation to collaborators Feb 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests