ITMS-90809:当我使用 react-native-webview 时不推荐使用 API

Use*_*488 2 ios testflight react-native

我正在使用 react-native-webview 但是当我将应用程序发布到 Testflight 时,它会发送给我:

应用商店连接

亲爱的开发者,

我们发现了您的应用程序“AlBiddaPark”1.2.19 (3​​7) 最近交付的一个或多个问题。请更正以下问题,然后重新上传。

ITMS-90809:不推荐使用的 API 使用 - 不再接受使用 UIWebView 的新应用程序。相反,使用 WKWebView 来提高安全性和可靠性。了解更多 ( https://developer.apple.com/documentation/uikit/uiwebview )。

此致,

应用商店团队

我怎么解决这个问题 ?

Imj*_*aad 6

1-在根文件夹屏幕命令中运行 grep -r UIWebView node_modules/* t

2- 检查需要更新的依赖项,不包括:

node_modules/反应原生

节点模块/地铁

node_modules/fbjs

更新所有外部依赖

4- 替换所有使用默认 react native 的 WebView。在https://github.com/react-native-community/react-native-webview上替换它

5- 在Podfile 中添加脚本

post_install do |installer|
 # REMOVE ALL WEB VIEWS
 react_project = Xcodeproj::Project.open("../node_modules/react- 
 native/React/React.xcodeproj")
 react_project.main_group["React/Views"].files.each do |file|

    if file.path.match(/^RCTWebView/)
       file.remove_from_project
    end

  end
  react_project.save
 end
Run Code Online (Sandbox Code Playgroud)

6- 运行pod install命令,你就完成了

  • 感谢您的回答,但不清楚,请您一步一步解释一下 (3认同)