DEV Community

Yaşar İÇLİ
Yaşar İÇLİ

Posted on

How can we fix "UIWebView will no longer be accepted" ?

When I publish our React-native App, we get a warning like this.

The solution to this is to delete RCTWebView.

Let's solve this with Fastlane.

cd ios/fastlane/
touch fix-uiwebview.rb
Enter fullscreen mode Exit fullscreen mode

The file fix-webview.rb is saved as follows.

fix-webview.rb

require 'xcodeproj'

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
Enter fullscreen mode Exit fullscreen mode

then we open the Fastfile file and add the following to the bottom lane.

Fastfile


platform :ios do

  desc 'Deploy to AppStore'
  lane :release do
    fix_uiwebview
    upload_to_app_store
  end

  lane :beta do
    fix_uiwebview
    upload_to_testflight
  end

  desc "Fix deprecated UIWebView"
  private_lane :fix_uiwebview do
    sh("ruby", "fix-uiwebview.rb")
  end 

end
Enter fullscreen mode Exit fullscreen mode

Thanks.

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay