Removed UIWEBVIEW from Ionic project but still getting rejected by the app store

At this point I’ve tried everything online to no avail. I keep getting rejected by the Apple store for using UIWEBVIEW even though I’ve followed all of the steps to remove it. In fact, I’m searching my entire project for UIWEBVIEW and can’t find it.

So far I’ve done the following:

According to Ionic’s website: Add to your config.xml file.

ionic cordova plugin remove cordova cordova-plugin-ionic-webview --save

removed ios platform then re-added the latest cordova-plugin-ionic-webview and ios. Initially when I searched the project I saw several uiwebview references but now there are none and I’m still getting rejected by Apple.

i really don’t know what to do at this point, Apple keeps rejecting me even though there’s no reference to uiwebview. I’ve followed Ionic’s documents suggesting to install the latest version of ionic cordova plugin add cordova-plugin-ionic-webview --save

cordova -v
9.0.0 (cordova-lib@9.0.1)

ionic cli -v 6.0.1

I also searched the entire project in xCode for all references of UIWebView and manually replaced it with WKWebView and it still got rejected.

I also searched the entire plugins dir for any occurrence of UIWebView

Searching for string references in xcode is not the correct solution for this.

  • Update your plugins to their latest releases
  • Update the ios platform to the latest release.

I really appreciate you responding @mhartington .

I’ve went through my plugins and updated to the latest versions based on what’s available for each one.

  "dependencies": {
    "@angular/common": "~8.2.14",
    "@angular/core": "~8.2.14",
    "@angular/fire": "^5.4.2",
    "@angular/forms": "~8.2.14",
    "@angular/platform-browser": "~8.2.14",
    "@angular/platform-browser-dynamic": "~8.2.14",
    "@angular/router": "~8.2.14",
    "@ionic-native/core": "^5.0.0",
    "@ionic-native/diagnostic": "^5.26.0",
    "@ionic-native/geolocation": "^5.23.0",
    "@ionic-native/google-plus": "^5.30.0",
    "@ionic-native/image-picker": "^5.32.0",
    "@ionic-native/ionic-webview": "^5.22.0-beta-1",
    "@ionic-native/splash-screen": "^5.32.0",
    "@ionic-native/status-bar": "^5.32.0",
    "@ionic/angular": "^5.0.0",
    "@ionic/storage": "2.2.0",
    "cc.fovea.cordova.purchase": "^10.1.1",
    "cordova-android-support-gradle-release": "^3.0.1",
    "cordova-ios": "^5.1.1",
    "cordova-plugin-androidx": "^3.0.0",
    "cordova-plugin-androidx-adapter": "^1.1.3",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-firebase-analytics": "^5.0.0",
    "cordova-plugin-firebase-messaging": "^5.0.1",
    "cordova-plugin-geolocation": "^4.1.0",
    "cordova-plugin-googleplus": "^7.0.1",
    "cordova-plugin-inappbrowser": "^3.2.0",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-ionic-webview": "^5.0.0",
    "cordova-plugin-splashscreen": "^6.0.0",
    "cordova-plugin-statusbar": "^2.4.3",
    "cordova-plugin-telerik-imagepicker": "^2.3.6",
    "cordova-plugin-whitelist": "^1.3.4",
    "cordova-sqlite-storage": "^5.1.0",
    "cordova-support-android-plugin": "^1.0.2",
    "cordova-support-google-services": "^1.4.1",
    "cordova.plugins.diagnostic": "^5.0.2",
    "core-js": "^2.5.4",
    "firebase": "^7.9.1",
    "geofire": "^5.0.1",
    "geofirex": "^0.1.0",
    "ionicons": "^4.5.10-0",
    "moment": "^2.24.0",
    "rxjs": "~6.5.1",
    "rxjs-compat": "^6.5.5",
    "tslib": "^1.9.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.803.20",
    "@angular/cli": "~8.3.23",
    "@angular/compiler": "~8.2.14",
    "@angular/compiler-cli": "~8.2.14",
    "@angular/language-service": "~8.2.14",
    "@ionic/angular-toolkit": "^2.1.1",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "^5.0.0",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-splashscreen": "^6.0.0",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.15.0",
    "typescript": "~3.4.3"
  },

And in xCode I have the following setting:

But I’m still getting this from Apple:
ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView

When I search in my project in VS Code I don’t get any references to UIWebView. But when I search in xCode I get the following:

/**
 When web application loads Add stuff to the DOM, mainly the user-defined settings from the Settings.plist file, and
 the device's data such as device ID, platform version, etc.
 */
- (void)webViewDidStartLoad:(UIWebView*)theWebView
{
    NSLog(@"Resetting plugins due to page load.");
    CDVViewController* vc = (CDVViewController*)self.enginePlugin.viewController;

    [vc.commandQueue resetRequestId];
    [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginResetNotification object:self.enginePlugin.webView]];
}

Some of these classes in xCode are prepended with

#if !WK_WEB_VIEW_ONLY

So i’m assuming it’s only to be used if I don’t have the wk webview only setting…which I do. This is extremely frustrating. I even removed and re-added the ios platform using the latest version 5.1.x

Upon further inspection, if I’m looking at these classes in xCode I can see that for these classes they’re for inAppBrowser.

CDVUIInAppBrowserViewController
But this isn’t even using UIWebView, it has a conditional statement:

#ifdef __CORDOVA_4_0_0
    #import <Cordova/CDVUIWebViewDelegate.h>
#else
    #import <Cordova/CDVWebViewDelegate.h>
#endif

and it’s implementing an interface that has a name containing UIWebView

@interface CDVUIInAppBrowserViewController : UIViewController <UIWebViewDelegate, CDVScreenOrientationDelegate>

There are no more references to UIWebView in the entire project, instead there are a few classes that have a name containing UIWebView.

You said you updates to the latest Versions? You have InAppBrowser Version 3.2.0 installed while the latest Version is 5.0.0. Try updating, as the UiWebView References are completely removed in 4.0.0

Also cordova-ios is already on 6.2.0 so you definitely not updated your dependencies to the latest once - you should recheck that or use a Tool for that

1 Like

@EinfachHans thanks…I was following a post that suggested upgrading to 3.0.0. So I’ve upgraded inApp browser to 5.0.0 and ios to 6.0.0 but I’m getting these errors:

I’m assuming these errors are from the ionic libraries (not sure if libraries is the correct word) that are installed along with the cordova plugins.

I’ve had to revert a lot by following tutorials online as they screw up other things so I don’t want to act on this until I know for certain how to proceed.

Should I just uninstall the Ionic library for firebase-message, in-app-purchase and in-app-browser?

Here are my package updates, but what exactly should i do with the ionic libraries for the plugins

    "@ionic/angular": "^5.0.0",
    "@ionic/storage": "2.2.0",
    "cc.fovea.cordova.purchase": "^10.1.1",
    "cordova-android": "^9.0.0",
    "cordova-android-support-gradle-release": "^3.0.1",
    "cordova-ios": "^6.0.0",
    "cordova-plugin-androidx": "^3.0.0",
    "cordova-plugin-androidx-adapter": "^1.1.3",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-firebase-analytics": "^5.0.0",
    "cordova-plugin-firebase-messaging": "^5.0.1",
    "cordova-plugin-geolocation": "^4.1.0",
    "cordova-plugin-googleplus": "^7.0.1",
    "cordova-plugin-inappbrowser": "^5.0.0",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-ionic-webview": "^5.0.0",
    "cordova-plugin-splashscreen": "^6.0.0",
    "cordova-plugin-statusbar": "^2.4.3",
    "cordova-plugin-telerik-imagepicker": "^2.3.6",
    "cordova-plugin-whitelist": "^1.3.4",
    "cordova-sqlite-storage": "^5.1.0",
    "cordova-support-android-plugin": "^1.0.2",
    "cordova-support-google-services": "^1.4.1",
    "cordova.plugins.diagnostic": "^5.0.2",

cordova-plugin-inappbrowser and @ionic-native/in-app-browser and two different packages. The cordova plugin is the actual implementation, while the Ionic native one is the types and wrappers around the plugin.
you need to install both and udpate them

2 Likes

Thanks @mhartington & @EinfachHans I followed your steps and I’m still getting rejected by Apple.

Here is my package.json

  "dependencies": {
    "@angular/common": "~8.2.14",
    "@angular/core": "~8.2.14",
    "@angular/fire": "^5.4.2",
    "@angular/forms": "~8.2.14",
    "@angular/platform-browser": "~8.2.14",
    "@angular/platform-browser-dynamic": "~8.2.14",
    "@angular/router": "~8.2.14",
    "@ionic-native/core": "^5.0.0",
    "@ionic-native/diagnostic": "^5.26.0",
    "@ionic-native/firebase-messaging": "^5.32.1",
    "@ionic-native/geolocation": "^5.23.0",
    "@ionic-native/google-plus": "^5.30.0",
    "@ionic-native/image-picker": "^5.32.0",
    "@ionic-native/in-app-browser": "^5.32.1",
    "@ionic-native/in-app-purchase-2": "^5.32.1",
    "@ionic-native/ionic-webview": "^5.22.0-beta-1",
    "@ionic-native/splash-screen": "^5.32.0",
    "@ionic-native/status-bar": "^5.32.0",
    "@ionic/angular": "^5.0.0",
    "@ionic/storage": "2.2.0",
    "cc.fovea.cordova.purchase": "^10.1.1",
    "cordova-android": "^9.0.0",
    "cordova-android-support-gradle-release": "^3.0.1",
    "cordova-ios": "^6.0.0",
    "cordova-plugin-androidx": "^3.0.0",
    "cordova-plugin-androidx-adapter": "^1.1.3",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-firebase-analytics": "^5.0.0",
    "cordova-plugin-firebase-messaging": "^5.0.1",
    "cordova-plugin-geolocation": "^4.1.0",
    "cordova-plugin-googleplus": "^7.0.1",
    "cordova-plugin-inappbrowser": "^5.0.0",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-ionic-webview": "^5.0.0",
    "cordova-plugin-splashscreen": "^6.0.0",
    "cordova-plugin-statusbar": "^2.4.3",
    "cordova-plugin-telerik-imagepicker": "^2.3.6",
    "cordova-plugin-whitelist": "^1.3.4",
    "cordova-sqlite-storage": "^5.1.0",
    "cordova-support-android-plugin": "^1.0.2",
    "cordova-support-google-services": "^1.4.1",
    "cordova.plugins.diagnostic": "^5.0.2",
    "core-js": "^2.5.4",
    "firebase": "^7.9.1",
    "geofire": "^5.0.1",
    "geofirex": "^0.1.0",
    "ionicons": "^4.5.10-0",
    "moment": "^2.24.0",
    "rxjs": "~6.5.1",
    "rxjs-compat": "^6.5.5",
    "tslib": "^1.9.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.803.20",
    "@angular/cli": "~8.3.23",
    "@angular/compiler": "~8.2.14",
    "@angular/compiler-cli": "~8.2.14",
    "@angular/language-service": "~8.2.14",
    "@ionic/angular-toolkit": "^2.1.1",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "^5.0.0",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-splashscreen": "^6.0.0",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.15.0",
    "typescript": "~3.4.3"
  },

When I do a search in xCode all of the UIWEBVIEW references are gone but I’m seeing this in

All of the UIWebView references that were there initially are gone. Now there’s only those references in the www root folder.

Ok…after a lot more searching I came across these methods to search for UIWebView.

anonymous@Anons-MBP Heathen Mingle 4-16-21, 3.42 PM.xcarchive % grep -R UIWebView *
Binary file Products/Applications/app name.app/App Name matches
Binary file dSYMs/app name.app.dSYM/Contents/Resources/DWARF/App Name matches

Do either of you know what exactly has to be done in those directories? What exactly is ‘matches’? I checked in the directory but what exactly am I looking for?

Again, String references to UIWebView is an incorrect way to resolve this. They will give you false positives as the results could be a type inference, or in the case of the JS results you showed, a variable name.

Update your plugins, do a clean build of your app, and look over the blog post we published some time ago.

So @mhartington I’ve upgraded all of my plugins and when I search in my project I no longer see any references to UIWebView. However, here’s my problem now:

So I’ve upgraded all of my plugins but my issue is Google Plus won’t install with cordova-ios 6.x. I can only get Google Plus installed with cordova-ios 5.1.1. The conflict is that cordova inapp browser won’t install on 5.1.1, it needs 6.x or greater. I’m not sure how to resolve this issue with two different cordova plugins requiring different cordova-ios versions.

Is there an alternative to inapp browser?
Is there a way to open browser links from ionic without inapp browser?

Someone in the Cordova slack channel suggested using the cordova-plugin-safariviewcontroller.