已弃用 API Usage Expo React Native

Deprecated API Usage Expo React Native

我有一个 expo RN 应用程序,上个月我能够成功上传到 TestFlight,但现在由于 AppStore 对 UIWebView 版本的贬值而被拒绝。我已经删除了 UIWebView 的所有引用,我已经清除了缓存,我已经刷新了 package-lock.json 甚至用 grep -r "UIWebView" . 命令强制删除了所有引用。什么都不起作用。每次我用 Expo 重建我的 iOs 应用程序然后上传到 TestFlight 时,构建都会失败并抛出这个一般的无用错误:This build is invalid.

我收到一封电子邮件,其中包含以下稍微有用的消息:

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

我发现一篇文章说我需要将我的 expo SDK 版本更新到 37,但是当我这样做时,我的应用程序中断了,因为我使用的是旧的 React 本机版本 (v 0.59),并且它们不兼容。

我真的不想拆开我的应用程序,更新 RN 版本,更新 expo SDK 版本,只让错误仍然存​​在。

有没有办法在我的 app.json 中更新我的 RN 和 expo SDK 版本而无需在 App Store Connect 上获取我的应用程序?

我已经看过的文档: https://developer.apple.com/documentation/uikit/uiwebview

app.json

{
"expo": {
"name": "companyname",
"slug": "companyname",
"privacy": "public",
"sdkVersion": "35.0.0",
"platforms": ["ios", "android", "web"],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/logo.png",
"splash": {
  "image": "./assets/logo_original.png",
  "resizeMode": "contain",
  "backgroundColor": "#ffffff"
},
"updates": {
  "fallbackToCacheTimeout": 0
},
"assetBundlePatterns": ["**/*"],
"ios": {
  "supportsTablet": true,
  "bundleIdentifier": "com.companyname.companyname",
  "buildNumber": "9.0.8"
},
"android": {
  "package": "com.companyname.companyname",
  "versionCode": 2.0,
  "config": {
    "googleMaps": {
      "apiKey": "123"
    }
  },
  "permissions": [
    "ACCESS_COARSE_LOCATION",
    "ACCESS_FINE_LOCATION",
    "CAMERA",
    "MANAGE_DOCUMENTS",
    "READ_CONTACTS",
    "READ_CALENDAR",
    "WRITE_CALENDAR",
    "READ_EXTERNAL_STORAGE",
    "READ_PHONE_STATE",
    "RECORD_AUDIO",
    "USE_FINGERPRINT",
    "VIBRATE",
    "WAKE_LOCK",
    "WRITE_EXTERNAL_STORAGE",
    "com.anddoes.launcher.permission.UPDATE_COUNT",
    "com.android.launcher.permission.INSTALL_SHORTCUT",
    "com.google.android.c2dm.permission.RECEIVE",
    "com.google.android.gms.permission.ACTIVITY_RECOGNITION",
    "com.google.android.providers.gsf.permission.READ_GSERVICES",
    "com.htc.launcher.permission.READ_SETTINGS",
    "com.htc.launcher.permission.UPDATE_SHORTCUT",
    "com.majeur.launcher.permission.UPDATE_BADGE",
    "com.sec.android.provider.badge.permission.READ",
    "com.sec.android.provider.badge.permission.WRITE",
    "com.sonyericsson.home.permission.BROADCAST_BADGE"
  ]
}
}
}

package.json

{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject",
"test": "jest",
"postinstall": "node overwrite/migrate.js"
},
"jest": {
"preset": "react-native"
},
"dependencies": {
"@ptomasroos/react-native-multi-slider": "^2.0.0",
"@react-native-community/datetimepicker": "^2.2.3",
"@shoutem/ui": "^1.0.4",
"add": "^2.0.6",
"expo": "35.0.0",
"expo-cli": "^3.20.3",
"expo-constants": "^8.0.0",
"expo-device": "^2.0.0",
"expo-file-system": "^7.0.0",
"expo-image-picker": "^7.0.0",
"expo-linear-gradient": "^7.0.1",
"expo-location": "^5.0.1",
"expo-permissions": "^5.0.1",
"faker": "^4.1.0",
"firebase": "~7.0.0",
"firebase-admin": "^8.10.0",
"react": "16.8.3",
"react-dom": "^16.8.6",
"react-native": "0.59.8",
"react-native-animatable": "^1.3.3",
"react-native-app-intro-slider": "^3.0.0",
"react-native-collapsible": "^1.5.1",
"react-native-datepicker": "^1.7.2",
"react-native-deck-swiper": "^1.6.7",
"react-native-device-info": "^5.5.3",
"react-native-draggable-flatlist": "^1.1.9",
"react-native-elements": "^1.2.6",
"react-native-flash-message": "^0.1.15",
"react-native-gesture-handler": "^1.2.2",
"react-native-gifted-chat": "^0.12.0-beta-0",
"react-native-google-places": "^3.1.2",
"react-native-google-places-autocomplete": "^1.3.9",
"react-native-image-slider-show": "^1.0.3",
"react-native-keyboard-aware-scroll-view": "^0.9.1",
"react-native-maps": "0.24.2",
"react-native-multi-slider": "^0.3.6",
"react-native-picker-select": "^6.3.3",
"react-native-screens": "^2.5.0",
"react-native-swiper-flatlist": "^2.0.3",
"react-native-vector-icons": "^6.6.0",
"react-native-view-overflow": "0.0.4",
"react-native-web": "^0.11.4",
"react-navigation": "^3.13.0",
"redux": "^4.0.4"
},
"rnpm": {
"assets": [
  "utils/Fonts/"
]
},
"devDependencies": {
"babel-eslint": "^10.0.3",
"babel-plugin-module-resolver": "^3.2.0",
"babel-preset-expo": "^5.2.0",
"eslint": "^6.6.0",
"eslint-config-react": "^1.1.7",
"eslint-config-react-native": "^4.0.0",
"eslint-import-resolver-babel-module": "^5.1.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-react": "^7.16.0",
"eslint-plugin-react-hooks": "0.0.0-f6b8d31a7",
"eslint-plugin-react-native": "^3.8.1",
"prettier": "^1.19.1"
},
"private": true
}

您需要更新到 SDK 37 以移除对 UIWebView 的所有依赖。有关详细信息,请参阅此博客 post,尤其是在 "UIWebView Removed" 标题下。 https://blog.expo.io/expo-sdk-37-is-now-available-dd5770f066a6