ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
12.28k stars 1.01k forks source link

App rejection due to ITMS-90809: UIWebView API Deprecation on an up to date Capacitor app (and no faulty plugins) #2877

Closed sabahang closed 4 years ago

sabahang commented 4 years ago

Bug Report

npx cap doctor output:

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/core 2.0.2
  @capacitor/android 2.0.2
  @capacitor/ios 2.0.2

Affected Platform(s)

Current Behavior

According to this blog post UIWebView references in CapacitorCordova pod shouldn’t trigger the warning (now rejection) from app store however since this week apple store is not letting me submit my ionic 5 with Capacitor and all packages with latest updates anymore.

You may notice “UIWebView” references within your Capacitor-based iOS project. Files within the “CapacitorCordova” pod, for example, relate to Cordova compatibility. These will not trigger the warning.

Taken from: https://ionicframework.com/blog/understanding-itms-90809-uiwebview-api-deprecation/

See the response of Apple on the screenshot below.

Expected Behavior

I would be able to submit my Capacitor with latest updates to app store

Sample Code or Sample Application Repo

I’m only using two Capacitor plugins which to my knowledge aren’t referencing UIWebView (see the second screenshot showing all the references from CapacitorCordova pod). These are the plugins I use:

"capacitor-fcm": "^2.0.0",
"capacitor-firebase-auth": "^0.3.1",

Is this the fault of Ionic or am I doing something wrong?

Here is my package.json file:

{
  "name": "xx",
  "version": "0.0.1",
  "private": true,
  "dependencies": {
    "@capacitor/android": "^2.0.2",
    "@capacitor/core": "^2.0.2",
    "@capacitor/ios": "^2.0.2",
    "@ionic/core": "^5.1.0",
    "@ionic/pwa-elements": "^1.5.2",
    "@ionic/react": "^5.1.0",
    "@ionic/react-router": "^5.1.0",
    "@types/node": "^12.12.38",
    "@types/react-dom": "^16.9.7",
    "@types/react-router": "^5.1.7",
    "@types/react-router-dom": "^5.1.5",
    "axios": "^0.19.2",
    "capacitor-fcm": "^2.0.0",
    "capacitor-firebase-auth": "^0.3.1",
    "countries-code": "^1.0.8",
    "date-fns": "^2.12.0",
    "firebase": "^7.14.2",
    "ionicons": "^5.0.1",
    "jetifier": "^1.6.5",
    "libphonenumber-js": "^1.7.51",
    "react": "^16.10.2",
    "react-dom": "^16.10.2",
    "react-hook-form": "^5.6.1",
    "react-router": "^5.1.0",
    "react-router-dom": "^5.1.0",
    "react-scripts": "^3.3.1",
    "typescript": "^3.7.5"
  },
  "scripts": {
    "start": "npm-run-all -p start:css start:js",
    "build": "npm-run-all build:css build:js",
    "start:js": "react-scripts start",
    "build:js": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "ionic:build": "npm run build && npx cap copy android && npx cap copy ios",
    "ionic:serve": "npm run start",
    "start:css": "postcss src/styles/styles.src.css -o src/styles/index.css -w",
    "build:css": "postcss src/styles/styles.src.css -o src/styles/index.css --env production"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "plugin:@ionic/recommended",
      "plugin:prettier/recommended",
      "prettier",
      "prettier/@typescript-eslint"
    ],
    "plugins": [
      "prettier"
    ],
    "env": {
      "browser": true,
      "node": true,
      "es6": true
    },
    "rules": {
      "prettier/prettier": [
        "error",
        {
          "endOfLine": "auto",
          "trailingComma": "none"
        }
      ],
      "@typescript-eslint/no-var-requires": "off"
    },
    "settings": {
      "react": {
        "pragma": "React",
        "version": "detect"
      }
    },
    "parser": "@typescript-eslint/parser",
    "parserOptions": {
      "project": "./tsconfig.json",
      "ecmaFeatures": {
        "jsx": true
      }
    }
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@capacitor/cli": "^2.0.2",
    "@fullhuman/postcss-purgecss": "^2.2.0",
    "@ionic/eslint-plugin": "0.0.1",
    "@types/jest": "^24.9.1",
    "autoprefixer": "^9.7.6",
    "eslint-config-prettier": "^6.11.0",
    "eslint-plugin-prettier": "^3.1.3",
    "npm-run-all": "^4.1.5",
    "postcss-cli": "^7.1.1",
    "prettier": "^2.0.5",
    "tailwindcss": "^1.4.4",
    "tailwindcss-pseudo-elements": "^1.1.2"
  },
  "description": "An Ionic project"
}

capacitor.config.json:

{
  "appId": "xxx",
  "appName": "xxx",
  "bundledWebRuntime": false,
  "npmClient": "npm",
  "webDir": "build",
  "cordova": {},
  "android": {
    "webContentsDebuggingEnabled": true
  },
  "server": {
  },
  "plugins": {
    "CapacitorFirebaseAuth": {
      "providers": [
        "phone"
      ],
      "languageCode": "en",
      "nativeAuth": false
    }
  }
}

Reproduction Steps

Build a release app from Xcode and try to upload it to Testflight or appstore

Other Technical Details

npm --version output: 6.14.4

node --version output: v14.1.0

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

PS: cross posted here: https://forum.ionicframework.com/t/capacitorcordova-pods-references-to-uiwebview-cause-app-store-rejections/188927

Other Information

image image image

jcesarmobile commented 4 years ago

Have you considered checking the plugin issues before reporting the issue affirming none of them is faulty? Or do a search on this repository?

Because the faulty plugin is capacitor-firebase-auth, it’s reported in their repository and has been reported here too https://github.com/ionic-team/capacitor/issues/2863

sabahang commented 4 years ago

@jcesarmobile thanks for the tip. Indeed you were right and I appreciate taking the time to find the issue for me. However I didn't suspect the plugin because it was rather difficult for me to detect that this plugin is the culprit as when you searched UIWebView in the project everything that came up was related to CapacitorCordova pod and nothing related to this plugin. Even the workaround in that plugin according to the issue you sent is around changing TwitterKit to TwitterKit5 which for an unfamiliar person has no immediate relation to UIWebView. This plugin is recommended amongst the Capacitor (non-Cordova) plugins on Capacitor Community plugins page and all the time I was under the impression that as it's not Cordova plugin it should be fine. It would be nice if recommended community plugins would have some compatibility notes or if you could advise a more bullet proof way (than above) to detect if a plugin is the culprit in this case. Thanks alot

jcesarmobile commented 4 years ago

Those are not recommended plugins, just user plugins. Anybody can submit their plugins there, we just check that they have a reasonable readme and support at least iOS and Android (unless it's something platform specific) That plugin was submitted 14 months ago when the ITMS-90809 problem wasn't a thing, and even if it was, it's not something we test when we accept the user plugins.

ITMS-90809 is not a cordova problem, it has affected all apps and frameworks as long as they used UIWebView. (even native apps) We fixed it in Capacitor in version 1.2.0 back in September. Doing a text search is not good for detecting the problem because Apple doesn't do that, they check for real UIWebView usage and Capacitor doesn't use it since 1.2.0.

The problem is usually in .framework files where you can't do text search inside. Frameworks from facebook, twitter, firebase, google, linkedin among others have had the problem and most of them have been updated, but plugins/libraries using the old version of the framework had not been updated and still have the problem.

Sadly I don't know how to do the search inside a .framework file. But the community plugin page links the github repository, so you can visit it and see if somebody already reported it, as in this case.

Changing TwitterKit to TwitterKit5 is not something you should do as an user, is something the plugin author should do, because it might require native code changes, and then do a new plugin release.

ionitron-bot[bot] commented 2 years ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.