react-native-webview / react-native-webview

React Native Cross-Platform WebView
https://github.com/react-native-community/discussions-and-proposals/pull/3
MIT License
6.25k stars 2.93k forks source link

iOS Deprecated API Usage Warning #819

Closed greis closed 4 years ago

greis commented 4 years ago

Just submitted my app to TestFlight and got an email with the error:

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

I was wondering if all the code related to UIWebView will have to be removed and only keep WKWebView.

It was just a warning, the build ended up being available on TestFlight, but I think this is something that will have to be addressed at some point.

AiTranXuan commented 4 years ago

I also got this error. Does anyone have a solution? Im using "react-native-webview": "^5.12.1" and "react-native": "0.59.10"

tarunbhutani commented 4 years ago

I have also received the same error, while I am not using UIWebview in my application at all.

eams1986 commented 4 years ago

Dear Developer,We identified one or more issues with a recent delivery for your app, "ClickButton" 1.0.0 (1.0.0). Your delivery was successful, but you may wish to correct the following issues in your next delivery:ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs . See https://developer.apple.com/documentation/uikit/uiwebview for more information.After you’ve corrected the issues, you can use Xcode or Application Loader to upload a new binary to App Store Connect.Best regards,The App Store Team

i am using game maker studio 2 and xcode :(

brunobar79 commented 4 years ago

I think it's because you're using react-native < 0.60 which still contains the <Webview> component, so now we're all probably forced to upgrade thanks to this new Apple policy 🤦‍♂

rendomnet commented 4 years ago

So now we cant use < 0.60 and publish to app store?

lchenfox commented 4 years ago

The same issue by Apple when uploading to App Store. There are any solutions?

See as follows:

image

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

Code snippet:

    <WebView
                    style={{flex: 1, backgroundColor: Colors.white}}
                    useWebKit={true}
                    startInLoadingState={true}
                    source={{uri: 'my http url'}}
     />

By the way, the react-native-webview I'm using is "react-native-webview": "5.8.1". Thanks.

slymeng commented 4 years ago

I also got this error, when use ionic( 4.12.0), while I am not using UIWebview in my application at all.

"cordova-plugin-ionic-webview": "^4.0.1",

filipecrosk commented 4 years ago

I think it's because you're using react-native < 0.60 which still contains the <Webview> component, so now we're all probably forced to upgrade thanks to this new Apple policy 🤦‍♂

I'm actually using version 0.60.4 and got the same error. And I'm not using any external library with UIWebView.

radko93 commented 4 years ago

@filipecrosk I don't think this is related to React Native (at least not 0.60). Search in your project (and node modules) for anything related to UIWebView. In my case, the issue is caused by https://github.com/BranchMetrics/react-native-branch-deep-linking-attribution

seanLee commented 4 years ago

@IljaDaderko I'am not using RN for developing.As a iOS developer,I got the same issue.I just class-dump my project and find there're some usages of UIWebView in other third-part framework that I can not change the code.It maybe a new rule for App Review.

ahirag commented 4 years ago

Same issue from Apple today, on "react-native-webview": "^5.6.2"

mikehardy commented 4 years ago

Your delivery was successful, but you may wish to correct the following issues in your next delivery:ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs

So, what's the date it converts from warning to hard fail?

[edit - doesn't seem like anyone knows yet, related discussion https://stackoverflow.com/questions/57700996/flutter-how-to-fix-itms-90809-deprecated-api-usage-apple-will-stop-accepting]

Titozzz commented 4 years ago

I guess we won't have a choice but to remove UIWebView.

This thread was used to keep track of the missing features with our WK implementation. I guess I'll need help to fix them if they are fixable.

lchenfox commented 4 years ago

If you are using useWebKit={true}, that is to say, you are using WKWebView not UIWebView at all. Then you can do the following to solve the problem -- Deprecated API Usage.

1. Remove Libraries/RNCWebView.xcodeproj/RNCUIWebView.h、RNCUIWebView.m、RNCUIWebViewManager.h、RNCUIWebViewManager.m 2. Remove Libraries/React.xcodeproj/React/Views/RCTWebView.h、RCTWebView.m、RCTWebViewManager.h、RCTWebViewManager.m

Now I has already uploaded app.ipa to AppStore successfully without any permission warnings.

That's all. I works for me. Hope it helps.

Titozzz commented 4 years ago

@Amos729 What's your react-native version? WebView should not be there anymore

lchenfox commented 4 years ago

@Amos729 What's your react-native version? WebView should not be there anymore

Yeah, it should be useful for lower react native version. Now I'm using 0.59.9. Maybe I will try to upgrade soon.

    System:
      OS: macOS 10.14.6
      CPU: (4) x64 Intel(R) Core(TM) i7-7660U CPU @ 2.50GHz
      Memory: 149.57 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 12.6.0 - /usr/local/bin/node
      Yarn: 1.17.3 - /usr/local/bin/yarn
      npm: 6.9.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
      Android SDK:
        API Levels: 24, 26, 27, 28
        Build Tools: 26.0.2, 27.0.3, 28.0.2, 28.0.3
        System Images: android-24 | Google APIs Intel x86 Atom, android-27 | Intel x86 Atom_64, android-28 | Intel x86 Atom_64
    IDEs:
      Android Studio: 3.0 AI-171.4443003
      Xcode: 10.3/10G8 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3 
      react-native: 0.59.9 => 0.59.9 
    npmGlobalPackages:
      react-native-cli: 2.0.1
      react-native-git-upgrade: 0.2.7
calix commented 4 years ago

Same issue for me. Not using UIWebView at all...

Biplovkumar commented 4 years ago

Same issue in react native 60.6 version. How I resolve that. Plz suggest ?

AlexMougenet commented 4 years ago

I know it's not that related to react-native, but just in case I have the same issue with an Ionic 4 app

boennemann commented 4 years ago

We tried to fix it like this:

  1. Add useWebkit to all WebViews
  2. Add an npm postinstall script: rm -f node_modules/react-native-webview/ios/RNCUIWebView*

It seems to me that this removes all usage related to this package.

However we depend on another SDK that uses AFNetworking, which has a similar problem: https://github.com/AFNetworking/AFNetworking/issues/4428 So I can't promise a 100% that it works.

cristianoccazinsp commented 4 years ago

Same issue here with RN 0.60.5

"react-native-webview": "6.9.0

edu1525 commented 4 years ago

Same issue here, i'm using react v0.59 and not using any WebViewer. Can anybody help-me?

mikehardy commented 4 years ago

I believe the current status is:

calix commented 4 years ago

I managed to solve the issue (archiving locally - still have a problem publishing to App store via AppCenter pipeline) by doing the following:

Running the following as part of post npm install:

rm -f ./node_modules/react-native-webview/ios/RNCUI*

This removes the UIWebView files related to my usage of react-native-webview community.

In addition to this, also removed the references to RTCWebView, RTCWebViewManager etc using Xcode, as described by Amos729 earlier (although I removed RTCWebView. in this step, not RNWebView.*).

Maxwell2022 commented 4 years ago

It looks like it's being removed in the 0.61-rc 0.60.x https://github.com/facebook/react-native/commit/6ca438a7f4bd7e6b317f0461aebbd5a7186151ed

AiTranXuan commented 4 years ago

If you are using useWebKit={true}, that is to say, you are using WKWebView not UIWebView at all. Then you can do the following to solve the problem -- Deprecated API Usage.

1. Remove Libraries/RNCWebView.xcodeproj/RNCUIWebView.h、RNCUIWebView.m、RNCUIWebViewManager.h、RNCUIWebViewManager.m 2. Remove Libraries/React.xcodeproj/React/Views/RNCWebView.h、RNCWebView.m、RNCWebViewManager.h、RNCWebViewManager.m

Now I has already uploaded app.ipa to AppStore successfully without any permission warnings.

That's all. I works for me. Hope it helps.

Thank you @Amos729 but i step 2: I don't find /RNCWebView.h、RNCWebView.m、RNCWebViewManager.h、RNCWebViewManager.m ; but i find RTCWebView.h ,RTCWebView.m , RTCWebViewManager.h, RTCWebViewManager.m I use React native 0.59.10 react 16.9.0.

lchenfox commented 4 years ago

If you are using useWebKit={true}, that is to say, you are using WKWebView not UIWebView at all. Then you can do the following to solve the problem -- Deprecated API Usage. 1. Remove Libraries/RNCWebView.xcodeproj/RNCUIWebView.h、RNCUIWebView.m、RNCUIWebViewManager.h、RNCUIWebViewManager.m 2. Remove Libraries/React.xcodeproj/React/Views/RNCWebView.h、RNCWebView.m、RNCWebViewManager.h、RNCWebViewManager.m Now I has already uploaded app.ipa to AppStore successfully without any permission warnings. That's all. I works for me. Hope it helps.

Thank you @Amos729 but i step 2: I don't find /RNCWebView.h、RNCWebView.m、RNCWebViewManager.h、RNCWebViewManager.m ; but i find RTCWebView.h ,RTCWebView.m , RTCWebViewManager.h, RTCWebViewManager.m I use React native 0.59.10 react 16.9.0.

Sorry. I wrote it wrongly before. It should be RCT. Now I get the previous comment updated.

image

image

mikehardy commented 4 years ago

@Maxwell2022 that same commit makes it appear the commit was present in the 0.60.x series as well. So I don't believe it is relevant from a "things to wait on" perspective, I believe current react-native release already has it fully removed, so it is just a matter of the modules (like react-native-device-info, which I maintain and has not removed yet - in progress) remove it

AiTranXuan commented 4 years ago

If you are using useWebKit={true}, that is to say, you are using WKWebView not UIWebView at all. Then you can do the following to solve the problem -- Deprecated API Usage. 1. Remove Libraries/RNCWebView.xcodeproj/RNCUIWebView.h、RNCUIWebView.m、RNCUIWebViewManager.h、RNCUIWebViewManager.m 2. Remove Libraries/React.xcodeproj/React/Views/RNCWebView.h、RNCWebView.m、RNCWebViewManager.h、RNCWebViewManager.m Now I has already uploaded app.ipa to AppStore successfully without any permission warnings. That's all. I works for me. Hope it helps.

Thank you @Amos729 but i step 2: I don't find /RNCWebView.h、RNCWebView.m、RNCWebViewManager.h、RNCWebViewManager.m ; but i find RTCWebView.h ,RTCWebView.m , RTCWebViewManager.h, RTCWebViewManager.m I use React native 0.59.10 react 16.9.0.

Sorry. I wrote it wrongly before. It should be RCT. Now I get the previous comment updated.

    1. Screenshot

image

    1. Screenshot

image

okey! Thank you very much

EdwinRozario commented 4 years ago

Same issue with latest version of Ionic app. We use "cordova-plugin-ionic-webview": "^4.1.1" which is using WKWebView. Still getting the error.

lchenfox commented 4 years ago

Same issue with latest version of Ionic app. We use "cordova-plugin-ionic-webview": "^4.1.1" which is using WKWebView. Still getting the error.

Please search file related to UIWebView in Xcode. Then delete the each file containing UIWebView. It may be gone. In addition, Apple will send a warning email as long as there is still a file referring to UIWebView even it's from any third-party until you remove all about it.

EdwinRozario commented 4 years ago

For Ionic devs. I found cordova-plugin-inappbrowser using webview. Have to pass usewkwebview=yes in options.

vTrip commented 4 years ago

Can someone confirm that this will become an immediate issue as soon as we start supporting/release for the new iOS 13.0 ?

eams1986 commented 4 years ago

If you are using useWebKit={true}, that is to say, you are using WKWebView not UIWebView at all. Then you can do the following to solve the problem -- Deprecated API Usage. 1. Remove Libraries/RNCWebView.xcodeproj/RNCUIWebView.h、RNCUIWebView.m、RNCUIWebViewManager.h、RNCUIWebViewManager.m 2. Remove Libraries/React.xcodeproj/React/Views/RNCWebView.h、RNCWebView.m、RNCWebViewManager.h、RNCWebViewManager.m Now I has already uploaded app.ipa to AppStore successfully without any permission warnings. That's all. I works for me. Hope it helps.

Thank you @Amos729 but i step 2: I don't find /RNCWebView.h、RNCWebView.m、RNCWebViewManager.h、RNCWebViewManager.m ; but i find RTCWebView.h ,RTCWebView.m , RTCWebViewManager.h, RTCWebViewManager.m I use React native 0.59.10 react 16.9.0.

Sorry. I wrote it wrongly before. It should be RCT. Now I get the previous comment updated.

    1. Screenshot

image

    1. Screenshot

image

hi! can you show the rout specific :) for get this file thanks

lchenfox commented 4 years ago

If you are using useWebKit={true}, that is to say, you are using WKWebView not UIWebView at all. Then you can do the following to solve the problem -- Deprecated API Usage. 1. Remove Libraries/RNCWebView.xcodeproj/RNCUIWebView.h、RNCUIWebView.m、RNCUIWebViewManager.h、RNCUIWebViewManager.m 2. Remove Libraries/React.xcodeproj/React/Views/RNCWebView.h、RNCWebView.m、RNCWebViewManager.h、RNCWebViewManager.m Now I has already uploaded app.ipa to AppStore successfully without any permission warnings. That's all. I works for me. Hope it helps.

Thank you @Amos729 but i step 2: I don't find /RNCWebView.h、RNCWebView.m、RNCWebViewManager.h、RNCWebViewManager.m ; but i find RTCWebView.h ,RTCWebView.m , RTCWebViewManager.h, RTCWebViewManager.m I use React native 0.59.10 react 16.9.0.

Sorry. I wrote it wrongly before. It should be RCT. Now I get the previous comment updated.

    1. Screenshot

image

    1. Screenshot

image

hi! can you show the rout specific :) for get this file thanks

-first

image

image

vladas3000 commented 4 years ago

Screenshot 2019-08-30 at 11 43 24

Simple solution to find every library using deprecated web view:

  1. enter webview in filter
  2. delete webview files which IS NOT WKWebView

Notice that pod files after pod install/update creates those deprecated files again

Titozzz commented 4 years ago

Please note that I'm releasing 7.0.0 soon.

Titozzz commented 4 years ago

Version 7.0.1 has been released (I messed up with the CI, hence the .1) Please do not forget to run pod install

https://github.com/react-native-community/react-native-webview/releases/tag/v7.0.1

developeromI89 commented 4 years ago

Same issue with latest version of Ionic app. We use "cordova-plugin-ionic-webview": "^4.1.1" which is using WKWebView. Still getting the error.

Please search file related to UIWebView in Xcode. Then delete the each file containing UIWebView. It may be gone. In addition, Apple will send a warning email as long as there is still a file referring to UIWebView even it's from any third-party until you remove all about it.

By deleting all files app stops working in Ionic. Did you implement that in Ionic?

developeromI89 commented 4 years ago

For Ionic devs. I found cordova-plugin-inappbrowser using webview. Have to pass usewkwebview=yes in options.

Did it work for you ? I changed it but not found any change in Ionic Code.

Titozzz commented 4 years ago

Please limit topics to react-native-webview

rendomnet commented 4 years ago

@Titozzz so can we remove UIWebView from RN <0.60 ? To avoid apple warning?

Titozzz commented 4 years ago

If you can't update to 0.60 or more this is the only solution. But make sure no dependency uses them :/

pierricklete commented 4 years ago

Following @Amos729 solution, for RN v0.59.10 if your are using cocoapods, you can remove the files in postinstall hook:

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
mikehardy commented 4 years ago

Fantastic @Titozzz - thanks for the quick release!

rendomnet commented 4 years ago

image I have deleted WebView but there is also FIRAuthWebView(it is counts as UIWebView?? ). I uploaded my app to Appstore and got warning that my app contains deprecated API UIWebView.

chamileb commented 4 years ago

I have these set of libraries, but still, get this error

image

OmalPerera commented 4 years ago

@chamileb try this

Right-click the project and Search for UIWebView  Some of the modules might use UIWebView. (in my case react-native-device-info was there) I changed the UIWebView to WKWebView as a dirty fix. It worked for me, but cannot guarantee 100%. worth to try until having a permanent fix as Titozzz said.

Screen Shot 2019-09-02 at 3 17 04 PM Screen Shot 2019-09-02 at 3 18 02 PM
matboud commented 4 years ago

I have also received the same error, while I am not using UIWebview in my application at all.

same here tho

yarapolana commented 4 years ago

Same here, I got this email about UIWebView but I am not using at all. Any solutions for this? Thanks