ITMS-90809: Deprecated API Usage when i use react-native-webview

Viewed 3978

i'm using react-native-webview but when i publish the app to Testflight it send me :

App Store Connect

Dear Developer,

We identified one or more issues with a recent delivery for your app, "AlBiddaPark" 1.2.19 (37). Please correct the following issues, then upload again.

ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview).

Best regards,

The App Store Team

How can i solve this problem ?

4 Answers

1- Run in root folder screen command grep -r UIWebView node_modules/* t

2- Check dependencies which need updated, excluding:

node_modules/react-native

node_modules/metro

node_modules/fbjs

Update all external dependencies

4- Replace all WebView what used default react native. Replace it on https://github.com/react-native-community/react-native-webview

5- Added script into 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

6- Run pod install command, and you are done

I faced this issue recently and here are the reasons I found and how I fixed it.

Reason - This issue occurs in two cases :-

  1. You are using old version of react-native-webview and it uses UIWebview which is no longer accepted by Apple Appstore.

Fix - Update the react-native-webview dependency. Refer this

  1. One of the package used by you in the app uses UIWebView instead of WKWebview.

Fix - You have to check which package uses the UIWebview. Use command grep -r "UIWebview" node_modules/* to search for uses in node_modules Use command grep -r "UIWebview" ios/ to search for uses in ios folder (This will show the Pods which are using old versions, ignore the mentions in the comments).

Now, you just have to update the versions of Pods or the packages in packages.json. In my case, I was using react-native-firebase v5 which was using old pods so I updated version to 5.6.0 and Pods to following versions :-

  pod 'Firebase/Core', '~> 6.13.0'
  pod 'Firebase/Messaging', '~> 6.13.0'
  pod 'Firebase/Auth',  '~> 6.13.0'
  pod 'AppAuth','~> 1.3.1'

So, in a nutshell, you just have to remove use of UIWebview and replace with WKWebView everywhere in your app.

WKWebView is now supported by React Native 0.57 and Expo SDK 31 Check here for more details

Try to find all including Pods folder UIWebview, make sure there's no file calling it and update those calling version accordingly.

For me the dependency was react-native-device-info. enter image description here

Related