ios ITMS-90809:不推荐使用的 API 使用——Apple 将停止接受使用 UIWebView API 的应用程序的提交

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/57722616/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 09:56:10  来源:igfitidea点击:

ITMS-90809: Deprecated API Usage -- Apple will stop accepting submissions of apps that use UIWebView APIs

iosswiftxcodeuiwebviewwkwebview

提问by Nick

Yesterday, I uploaded my App to TestFlight and after a while Apple sent me this warning:

昨天,我将我的应用程序上传到了 TestFlight,过了一会儿,Apple 向我发送了这个警告:

ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs . See https://developer.apple.com/documentation/uikit/uiwebviewfor more information.

ITMS-90809:不推荐使用 API - Apple 将停止接受使用 UIWebView API 的应用程序的提交。有关更多信息,请参阅https://developer.apple.com/documentation/uikit/uiwebview

The thing is that I don't use UIWebView in my app so I tried to update my pods but still the same thing.By the way this is my 3rd build on TestFlight and this is the first time apple sends me this. Any ideas?

问题是我没有在我的应用程序中使用 UIWebView 所以我尝试更新我的 pods 但仍然是同样的事情。顺便说一下,这是我在 TestFlight 上的第三次构建,这是苹果第一次向我发送这个。有任何想法吗?

Update

更新

These are my pods:

这些是我的豆荚:

pod 'Firebase/Core'
pod 'Firebase/Firestore'
pod 'Firebase/MLVision'
pod 'Firebase/MLVisionTextModel'
pod 'SVProgressHUD'
pod 'SPPermission/Camera'
pod 'SPPermission/PhotoLibrary'
pod 'Mantis'
pod 'SwiftKeychainWrapper'
pod 'SwiftyOnboard'
pod 'Fabric'
pod 'Crashlytics'

Update 2

更新 2

Seems like I found the frameworks with the issue.

好像我找到了有问题的框架。

Binary file ./Pods/FirebaseMLCommon/Frameworks/FirebaseMLCommon.framework/FirebaseMLCommon matches
Binary file ./Pods/Crashlytics/iOS/Crashlytics.framework/Crashlytics matches
Binary file ./Pods/GoogleMobileVision/Detector/Frameworks/GoogleMobileVision.framework/GoogleMobileVision matches

So now do I have to wait for google to fix them and update my pods?

那么现在我必须等待谷歌修复它们并更新我的豆荚吗?

采纳答案by Nick

I will answer my own question as I have news about this email. Google told me that there are several tickets about this issue and they are going to resolve this as soon as possible. Also today my app has been approved for the AppStore so it seems to be just a warning for the time being.

我会回答我自己的问题,因为我有关于这封电子邮件的消息。谷歌告诉我有几个关于这个问题的票,他们会尽快解决这个问题。同样,今天我的应用程序已被 AppStore 批准,因此暂时似乎只是一个警告。

回答by iNardex

Check if you use in your code the UIWebView class; if yes replace your implementation with WKWebView, else need check your Pods.

检查您是否在代码中使用了 UIWebView 类;如果是,请用 WKWebView 替换您的实现,否则需要检查您的 Pod。

Go with terminal into your project folder and execute the command: grep -r "UIWebView" .

使用终端进入您的项目文件夹并执行命令: grep -r "UIWebView" .

All matched pod must be updated. Now I'm stuck because I found UIWebView into Google AdMob (version 7.49.0) and I'm waiting a new version from Google.

必须更新所有匹配的 pod。现在我被卡住了,因为我在 Google AdMob(7.49.0 版)中找到了 UIWebView,我正在等待 Google 的新版本。

回答by Rudedog

You can examine each of the frameworks in the archived app to see if any of them refer to UIWebView. From the command line, cdto the archived app, e.g.:

您可以检查存档应用程序中的每个框架,看看它们中是否有任何引用UIWebView. 从命令行,cd到存档的应用程序,例如:

cd ~/Library/Developer/Xcode/Archives/<date>/myapp.xcarchive/Products/Applications/myapp.app

Once there, use the nmcommand to dump the symbols of your app and each of the app's frameworks:

在那里,使用nm命令转储您的应用程序和每个应用程序框架的符号:

nm myapp | grep UIWeb
for framework in Frameworks/*.framework; do
  fname=$(basename $framework .framework)
  echo $fname
  nm $framework/$fname | grep UIWeb
done

This will at least tell you which framework is the culprit.

这至少会告诉你哪个框架是罪魁祸首。

回答by jawadAli

WKWebViewis the replacement for UIWebView. If you don't have UIWebViewusage in your code than by executing the below terminal command you can easily get to know that which library is still using UIWebViewreference (don't miss the . (dot)).

WKWebView是 的替代品UIWebView。如果您UIWebView的代码中没有使用,则通过执行以下终端命令,您可以轻松了解哪个库仍在使用UIWebView引用(不要错过 .(点))。

From the command line, cd to the archived app, e.g

从命令行, cd 到存档的应用程序,例如

cd ~/Library/Developer/Xcode/Archives/<date>/myapp.xcarchive/Products/Applications/myapp.app

And then Run

然后运行

grep -r UIWebView

ORcall

致电

 grep -r UIWebView /Path/To/Project/*

This will give you Output for framework match

这将为您提供框架匹配的输出

./<ANY>.framework/Headers/ANY.h:#define ANYUseUIWebView ANY_NAME_PASTE(ANY_PREFIX_NAME, ANYUseUIWebView)

Output for library match

库匹配的输出

Binary file ./<FRAMEWORK-NAME>.framework/<LIB-FILE>.a matches

Update these Libraries

更新这些库

pod update

also check out this Medium Article

还可以查看这篇中等文章

回答by Vikrant s

Use latest firebase version

使用最新的 Firebase 版本

https://firebase.google.com/support/release-notes/ios

https://firebase.google.com/support/release-notes/ios

Version 6.8.1 : Removed references to UIWebViewDelegate to comply with App Store Submission warning (#3722).

版本 6.8.1:删除了对 UIWebViewDelegate 的引用以符合 App Store 提交警告 (#3722)。

回答by Dalton Lima

If you are building with Unity 3D, this is a know-issue (acknowledged in changelogs), it's currently fixed for version 2019.3 (being tested and backported).

如果您使用 Unity 3D 进行构建,这是一个已知问题(在变更日志中已确认),目前已针对 2019.3 版(正在测试和向后移植)进行修复。

Check the ticket here https://unity3d.com/unity/whats-new/2019.2.4

在此处查看门票https://unity3d.com/unity/whats-new/2019.2.4

回答by Zeerak Hameem

It was a long process, but I managed to solve the above mentioned issue. Let me walk you through the process and share my findings. First things first, its not necessary what worked for me will work for you. You juts need to try every possible solution put out there. I followed some of the solutions posted in various threads. (Linked below).

这是一个漫长的过程,但我设法解决了上述问题。让我带您完成整个过程并分享我的发现。首先,对我有用的不一定对你有用。您需要尝试所有可能的解决方案。我遵循了在各个线程中发布的一些解决方案。(链接如下)。

  1. When I was on RN 0.59, I found these files comment mentioned here. Didn't work
  2. I upgraded to RN 0.61, I didn't find these files. I tried uploading the app but still got the warning. Didn't work
  3. I updated the following libraries to their latest versions. Didn't workreact-native-device-info react-native-view
  4. I tried this grep command mentioned here. There were certain libraries that showed up i.e react-native-fbsdk, react-native-google-sign, react-native-gesture-handler. So I upgraded all of them and uploaded the build but still got the warning. Didn't work

  5. The last resort to update all the libraries, which i know was going to take a lot of time. So my first guess was to update 'react-native-firebase' to latest v6 version issue. But it had some issues with Notification not being on so I couldn't use it. Also they mentioned that their v.5.5.6 is clean and doesn't have any UIWebViewIssues given you update your iOS sdk to 6.12.+ More info here. So this moved me to my second guess which in my case was 'react-native-ux-cam'. Luckily they updated their library to remove all the references of UIWebView. I updated to the lastest version and BOOM, the issue was solved. I submitted my app to Apple and no warnings so far. More info hereWorked

  1. 当我使用 RN 0.59 时,我发现这里提到了这些文件注释。没用
  2. 我升级到RN 0.61,我没有找到这些文件。我尝试上传应用程序,但仍然收到警告。没用
  3. 我将以下库更新为最新版本。没有反应 react-native-device-info react-native-view
  4. 我试过这里提到的这个 grep 命令。出现了某些库,即 react-native-fbsdk、react-native-google-sign、react-native-gesture-handler。所以我升级了所有这些并上传了构建,但仍然收到警告。没用

  5. 更新所有库的最后手段,我知道这将花费很多时间。所以我的第一个猜测是将 'react-native-firebase' 更新到最新的 v6 版本issue。但是它有一些没有打开通知的问题,所以我无法使用它。他们还提到他们的 v.5.5.6 是干净的并且没有任何 UIWebViewIssues 给你更新你的 iOS sdk 到 6.12.+ 更多信息在这里。所以这让我想到了我的第二个猜测,在我的情况下是“react-native-ux-cam”。幸运的是,他们更新了他们的库以删除 UIWebView 的所有引用。我更新到最新版本和BOOM,问题解决了。我向 Apple 提交了我的应用程序,到目前为止没有任何警告。更多信息在这里工作

Hope this helps someone.

希望这可以帮助某人。

回答by ceekay

In my case, Firebase/Authwas using deprecated UIWebView API and the version I was using was an older one. So I just updated the Firebase/Authpod using the command,

就我而言,Firebase/Auth使用的是已弃用的 UIWebView API,而我使用的版本是旧版本。所以我只是Firebase/Auth使用命令更新了pod,

pod update 'Firebase/Auth'

pod update 'Firebase/Auth'

Note: To figure out the frameworks which are using this api, just search "UIWebView" (cmd+shift+F)

:找出哪些使用此API的框架,只是搜索“的UIWebView”(cmd+ shift+ F

回答by Lalit Baghel

When you build an Ionic app, you can choose between Cordova or Capacitor to deploy a native mobile version. While more recent versions use WKWebView automatically, Cordova still uses UIWebView APIs outright or contain references to them (Capacitor has been updated to remove these references – see below).

在构建 Ionic 应用程序时,您可以选择 Cordova 或 Capacitor 来部署原生移动版本。虽然较新的版本自动使用 WKWebView,但 Cordova 仍然直接使用 UIWebView API 或包含对它们的引用(电容器已更新以删除这些引用 - 见下文)。

Upon app submission, Apple searches the app's code for the “UIWebView” string then generates a submission warning if found. Therefore, a future release of cordova-ios (the Cordova iOS library) will be required to ensure that all references to UIWebView APIs removed.

提交应用程序后,Apple 会在应用程序代码中搜索“UIWebView”字符串,如果找到则生成提交警告。因此,将需要 Cordova-ios(Cordova iOS 库)的未来版本以确保删除对 UIWebView API 的所有引用。

another thought. I don't know if it makes sense or is technically possible.

另一个想法。我不知道这是否有意义或技术上可行。

Move UIWebView to a plugin as well and make cordova-ios use this or some of the WKWebView plugins. cordova-ios just contains the code to load a webview. By default the next version should load the Apache WKWebViewEngine (Plugin installed by default on new apps, Migration instruction for old apps). Users who need UIWebView, the Ionic one, a fork or others can specify their own one like it is now.

也将 UIWebView 移动到插件中,并使 cordova-ios 使用这个或一些 WKWebView 插件。cordova-ios 只包含加载 webview 的代码。默认情况下,下一个版本应加载 Apache WKWebViewEngine(新应用程序上默认安装插件,旧应用程序的迁移说明)。需要 UIWebView、Ionic、fork 或其他人的用户可以像现在一样指定自己的一个。

That way no UIWebView would be in cordova-ios and it would still be flexible enough like today.

这样一来,cordova-ios 中就没有 UIWebView 了,而且它仍然像今天一样灵活。

回答by Alfredo Luco G

If anyone helps I run pod updateon terminal and then archive again. That works for me.

如果有人帮助我pod update在终端上运行,然后再次存档。这对我行得通。