96

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

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.

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?

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

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?

Jawad Ali
  • 13,556
  • 3
  • 32
  • 49
Nick
  • 1,434
  • 1
  • 10
  • 19
  • Check what Pods you're using and if they use a UIWebView. For example banner SDKs, but you might want to check other SDKs as well. – Gerharbo Aug 30 '19 at 08:59
  • 1
    @Gerharbo I use only Firebase pods and I can't find UIWebView inside them. – Nick Aug 30 '19 at 09:02
  • For those using cordova + reactjs (or angular) check out [cordova-plugin-wkwebview-engine](https://github.com/apache/cordova-plugin-wkwebview-engine) and [cordova-plugin-wkwebviewxhrfix](https://github.com/TheMattRay/cordova-plugin-wkwebviewxhrfix) – Jacksonkr May 11 '20 at 13:44

23 Answers23

108

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

Go with terminal into your project folder and execute the command: 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.

thedp
  • 8,350
  • 16
  • 53
  • 95
iNardex
  • 1,132
  • 1
  • 5
  • 7
  • 24
    When I entered the command in terminal , I'm getting the following warning "grep: warning: recursive search of stdin" and It doesn't return any response even after 30 mins.Any ideas ? – Durai Amuthan.H Sep 17 '19 at 08:22
  • 1
    Worked perfectly. I used this to find out UnityAds.framework is using UIWebView. They need to update to WKWebView. – apollosoftware.org Feb 22 '20 at 08:07
  • 1
    Maybe you will get result like below.. Binary file /Users/xxx/xxxx/xxxx.xcworkspace/xcuserdata/xxx.xcuserdatad/UserInterfaceState.xcuserstate matches. I solved it by delete my xcworkspace and pod install again. – ShaoJen Chen Mar 04 '20 at 08:27
  • 3
    Do you still get this @WilliamNardo? Even though I've updated past the supposed release to fix it: "`7.55.0 Removed all references to UIWebView. UIWebView is no longer supported.`", `Installing Google-Mobile-Ads-SDK 7.56.0 (was 7.53.1)` , I still get `Binary file Pods/Google-Mobile-Ads-SDK/Frameworks/GoogleMobileAdsFramework-Current/GoogleMobileAds.framework/GoogleMobileAds matches` – 10623169 Mar 13 '20 at 11:33
  • 19
    @DuraiAmuthan.H check you added the period/full-stop (.) at the end of the grep command. I initially made the same mistake – Wheelie Apr 30 '20 at 19:24
  • This seems to be giving me a LOT of false positives, despite me not being able to find a reference to UIWebView in any of them. – Ash Nov 13 '20 at 15:41
  • @DuraiAmuthan.H go to project folder in ternminal try: grep -r -F "UIWebView" . with full stop at end which indicates current directory and it will return all the UIWebView location in terminal. – Renascent Feb 19 '21 at 11:24
72

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

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

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

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.

Rudedog
  • 4,323
  • 1
  • 23
  • 34
  • Thank you for your answer it helped a lot. I will update my question with further informations. – Nick Aug 31 '19 at 15:23
  • So now the only thing I can do is to wait for google to resolve the issues? – Nick Sep 02 '19 at 09:24
  • 2
    Yes, you will need to wait (or fix them yourself and submit a pull request). I’m not sure what the exact deadline is to remove all uses of `UIWebView`, but I highly doubt that it will be before iOS 13 is released this fall. – Rudedog Sep 03 '19 at 14:23
  • @Rudedog how can I fix the frame works my self? First of all thank you for your answer... after following your answer it seems like I have 4 frameworks that are using UIWebView>>>>>> Alamofire Cosmos NMSSH Stripe – johnny Sep 05 '19 at 04:18
  • 2
    @johnny you would have to clone each repository and find out where they use UIWebView, remove or replace the code that uses it, and possibly submit pull requests if you want your changes to go back into the main repository. Or, you could just wait for the maintainers to fix it themselves. As I mentioned before, right now Apple is just warning devs about this and not actually rejecting binaries, so you have some time to wait for the upstream maintainers to fix things. – Rudedog Sep 05 '19 at 05:00
  • This is brilliant! I know it doesn't solve the issue, but it at least helps identify the problematic framework. – Myxtic Sep 07 '19 at 00:00
  • I have a mixed native / React Native app and although this grep script doesn't reveal any UIWebView instances I'm still getting the warning from Apple. Is there any other way for me to determine where this issue might be coming from? – Stoph Dec 17 '19 at 21:53
  • It might be in a dsym and not a framework. Try the `grep -rl UIWebView .` command as suggested below. – Rudedog Dec 18 '19 at 00:01
  • I get the following output when I run nm myapp | grep UIWeb: `U _OBJC_CLASS_$_UIWebView` But what does it mean? I can't find the reference when normally searching through code – mohsinulhaq May 02 '20 at 21:37
  • I have updated all UIWebViews to WKWebView. I also updated all pods in the projects. When I globally search for UIWebView, then it shows no result. Also, I used the command "nm myapp | grep UIWeb ...... done " and it shows no pods with UIWebView. But still, the iOS app does not appear on iTunes account activity. It was removed by Apple. Does anyone have any idea why the app is removed? – Akash Sharma May 03 '20 at 08:00
  • It is unlikely that the app was removed due to use of `UIWebView`. While Apple has said that they won't accept submissions that use it, they've never said that they would be proactively removing apps from the store for using it. – Rudedog May 04 '20 at 17:01
  • Sorry for the misunderstanding. Apple removed the build, not the live app. On running command it show: "Binary file ./dSYMs/Eureka.framework.dSYM/Contents/Resources/DWARF/Eureka matches". Is it fine or we have to change? – Akash Sharma May 05 '20 at 07:30
  • How to execute that `for` loop in this answer? Do I need to make a bash script file? I tried to add backslash on each line before newline in bash prompt, but this didn't work for me. – Carolus May 29 '20 at 07:54
  • @Carolus bash (and ksh, sh, csh, etc.) lets you input that directly in the terminal exactly as you see it. No need to add backslashes or anything like that. – Rudedog May 29 '20 at 15:58
  • @Rudedog Ah so it is intended that the `nm myapp | grep UIWeb` runs separately from the for loop? Also I made a mistake by attributing the error I got (lack of Frameworks dir, possibly due to being a Cordova project archive) to a syntax error. – Carolus Jun 03 '20 at 08:35
  • i saw "U _OBJC_CLASS_$_UIWebView" and a list of pod dependencies. but i cant find "UIWebView" in the source Code in those dependencies. what does it mean? – Carl Hung Aug 13 '20 at 02:29
  • I want to buy you a beer – David Velarde Oct 08 '20 at 08:19
8

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.

Nick
  • 1,434
  • 1
  • 10
  • 19
  • Hi can you direct to some solution, I am also facing the same issue. App is not approving even after so may hit and trials.. – Dinesh Rawat Jul 13 '20 at 13:05
8

For project with cocoapods:

grep -r UIWebView Pods/ 
hstdt
  • 5,652
  • 2
  • 34
  • 34
7

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

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

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

And then Run

grep -r UIWebView

OR call

 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

Jawad Ali
  • 13,556
  • 3
  • 32
  • 49
  • use "grep -r -F "UIWebView" ." istead of "grep -r UIWebView" – Manish May 14 '20 at 09:18
  • 1
    In Mac use "grep -r UIWebView ." in project path (with space and point at the end) – Vins Jul 09 '20 at 08:27
  • Already upgraded all pods those were using `UIWebView` (e.g AFNetworking, ZDCChat) and also checked updated pods as they're already upgraded for WKWebView but still `grep -r UIWebView .` gives me same pod list for `UIWebView` matches and apple also gives warning while submitting app on the iTunesconnect – Sunil Targe Aug 17 '20 at 07:52
  • `./Pods/Target Support Files/AFNetworking/AFNetworking-umbrella.h:#import "UIWebView+AFNetworking.h" Binary file ./Pods/ZDCChat/ZDCChatAPI.framework/ZDCChatAPI matches Binary file ./Pods/ZDCChat/ZDCChat.framework/ZDCChat matches Binary file ./Pods/.git/index matches` – Sunil Targe Aug 17 '20 at 07:53
  • `ZDCChatAPI` this pod uses `uiwebview` – Jawad Ali Aug 17 '20 at 07:55
  • @jawadAli any solution on that? – Sunil Targe Aug 18 '20 at 03:07
4
brew install ripgrep 
cd Pods
rg UIWebView
YoutubePlayer-in-WKWebView/README.md
10:- using WKWebView instead of UIWebView.

TTTAttributedLabel/TTTAttributedLabel/TTTAttributedLabel.h
166: to emulate the link detection behaviour of UIWebView.

TwitterKit/iOS/TwitterKit.framework/Headers/Twitter.h
28:     * either UIWebView or SFSafariViewController depending on iOS

TwitterKit/iOS/TwitterKit.framework/Headers/TWTRTweet.h
84: *  Suitable for loading in a `UIWebView`, `WKWebView` or passing to Safari:
Svitlana
  • 2,938
  • 1
  • 29
  • 38
  • and what is the solution here? just printed out inside comments, should comments be removed for to solve the issue? – Hiti3 Mar 08 '22 at 20:12
4

In order to find where you are using a UIWebView, Go to your project root in terminal and use this command

grep -r -F "UIWebView" .

The '.' is very important.

It tells the system to search the string "UIWebView" in the current folder and subfolders. This will search the cocoapods libraries also

Amal T S
  • 3,327
  • 2
  • 24
  • 57
3

I solved this issue by updating ionic webview plugin and adding preferences in config.

I followed following steps:

1.cordova plugin rm cordova-plugin-ionic-webview

2.cordova plugin add cordova-plugin-ionic-webview@latest

3.Added preferences in config file under ios platform :

<preference name="WKWebViewOnly" value="true" />
    <feature name="CDVWKWebViewEngine">
        <param name="ios-package" value="CDVWKWebViewEngine" />
    </feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />

After following these steps my app is submitted and later approved in review.

2

Use latest firebase version

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

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

Vikrant s
  • 21
  • 1
2

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).

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

2

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 work react-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 here Worked

Hope this helps someone.

2

Backstory

On my ReactJS + Cordova project I uploaded an app to the app store and it was successful. Shortly after I received an email citing ITMS-90809: Deprecated API Usage. After hours (over days) of research and multiple failed uploads I connected with Apple using a paid developer token ($50); they responded basically saying "check your node modules folder" and refunded my token because they weren't going to assist me with this extremely ambiguous error.

Previous Attempts

  • Updated cordova to use the wkwebview-engine and wkwebviewxhrfix plugins
  • Using grep -r on archives, ios source, and entire project source, I found a LOT of notes but nothing that really helped.
  • updated all npm packages
  • cleaned and updated all cocoapod pods

Final Attempt

After removing all "extra" cordova plugins, npm packages, and pods I was left with a shell of an application but still facing the apple rejection. using grep -r again there was still a reference to "facebook" which lead me to an old copy of the FBSDK.

Solution

FBSDK had been manually added to target > Build Phases > Link Binary With Libraries. There was also an associated cordovaFacebook.m in target > Build Phases > Compile Sources. After removing these old, un-maintained files I was able to upload to itunes connect without at issue.

Community
  • 1
  • 1
Jacksonkr
  • 31,583
  • 39
  • 180
  • 284
1

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

pod update 'Firebase/Auth'

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

ceekay
  • 1,136
  • 13
  • 11
  • So this is what I did and apparently it says Installing FirebaseInstanceID 4.2.5 (was 4.2.2) and didnt solve my problem – Jules Lee Sep 25 '19 at 12:26
1

FB Sdk above Version 7.16.1 have this issue. Actually it have no files in framework folder.

This error remove when you build it using FBSDK v7.16.1, but Appstore got rejected the app, because of depreciated api usage(UIWebView).

I resolve it by using FBSDK v7.19.2.

1) When you build the project for xcode it shows the mention error, shareKit not found. I resolve it by copy the facebookSDK folder from the framework folder of my previous build(with fbsdk v7.16.1), into the same location of the current xcode folder(frameworks/FacebookSDK....)

2) Then, open your xcode project, add files from location: Frameworks/FacebookSDK/Plugins/IOS/ (sharekit, corekit, loginkit) into Frameworks in Xcode.

3) Add "$(PROJECT_DIR)/Frameworks/FacebookSDK/Plugins/iOS" into Framework Search Paths into build settings at Xcode.

4) Open Project into Terminal: type "grep -r "UIWebView" ." , if this shows any match with UIWebView remove it by opening the file.

5) If it shows match in a binary file of FBSDKCoreKit. Open the file in TextEdit at MAC and Find and Replace all "UIWebView" to "WKWebView"

6) Save it and again add it into Frameworks at Xcode. Build and push to appstore.

Aqib Ahmed
  • 29
  • 1
  • 7
1

100% Working Solution #ionic #wkwebview #webview

Here Webview is deprecated by Apple so replace with WKWebview.

Follow few simple steps for solve this issue:-

1.Open Terminal and go to project path 
2.cordova plugin rm cordova-plugin-ionic-webview
3.cordova plugin add cordova-plugin-ionic-webview@latest
4.open config.xml file and put below code inside <platform name="ios"> section.
 
   <preference name="WKWebViewOnly" value="true" />
   <feature name="CDVWKWebViewEngine">
      <param name="ios-package" value="CDVWKWebViewEngine" />
   </feature>
   <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />

after following all this step again build using "ionic cordova build ios" command and submit it to again in appstore.

Maulik Patel
  • 2,045
  • 17
  • 24
0

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).

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.

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.

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

0

I faced the same for React native app. Check below things :

1) You are using react-native-webview module rather than importing it directly from react-native(community webview is deprecated as a lean core removal in v0.60 and will be removed in the next stable release). (check here)

2) Please also verify if you are using any third-party libraries which use webview is up to date, If not please ask the library maintainers to upgrade the react-native-webview.

3) you are good to go for the upload, Please add comments if anyone finds some more difficulties.

Check here the breaking changes in v0.60

Another way to get rid of this warning is: start passing 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.

<WebView
 style={{flex: 1, backgroundColor: Colors.white}}
 useWebKit={true}
 startInLoadingState={true}
 source={{uri: 'my http url'}}
/>```
Shashank Malviya
  • 670
  • 6
  • 17
0

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

Alfredo Luco G
  • 876
  • 7
  • 18
0

For me, scripts didn't help. I had to just manually go through each framework and look at release note, and update them.

green0range
  • 557
  • 6
  • 18
0

I get rid out from this by following below steps-

Step 1:

Search “UIWebView” in xcode project directory

Step 2:

Right click (on RCTWebView.m) and select “Reveal In Project Navigator”

Step 3:

Scroll down and delete the following four files only:

 1. RCTWebView.h
 2. RCTWebView.m
 3. RCTWebViewManager.h
 4. RCTWebViewManager.m

Then clean the project & archive.

N.B: If you use 'react-native-community/react-native-webview' library then update with latest version otherwise it's done.

Ali Hasan
  • 3,843
  • 1
  • 5
  • 9
0

You should install this Cordova Plugin:

https://github.com/apache/cordova-plugin-wkwebview-engine

Then add <preference name="WKWebViewOnly" value="true" /> in your config.xml, under the iOS section.

Then increase the version and re-upload it.

Raz Buchnik
  • 7,753
  • 14
  • 53
  • 96
0

To update WebView depreceated in ios

This solved my problem successfully

cd platforms/ios grep -r UIWebView Pods/

Open Podfile and add/replace AFNetworking pod as

pod 'AFNetworking', '~> 4.0'

Finally in terminal pod update

alonly
  • 1
  • 1
0

As per new Apple policies, the new/old apps that use UIWebView are no longer accepted. The best solution is to use WKWebView for improved security. The issue is there because of some deprecated old plugins like GoogleAd or GoogleVR SDK. If you want a quick solution then replace the UIWebView with WKWebView framework.

In Terminal, run this command in your iOS project folder:

grep -r "UIWebView"

Then you will find the list of all the files that use UIWebview. Update whatever files to use WKWebView (Or replaced them with WKWebView using gVim). If your pod libraries are showing that it has UIWebView. Update the pods files as well.

In my case, the unsupported plugin was GVR SDK and steps to resolve are:

Step1: Remove UIWebView:

  1. Get vim for mac.
  2. List item In Vim open {Path to your build folder} \Pods\GVRSDK\Libraries\libGVRSDK.a
  3. Click ESC
  4. Type ":"
  5. Paste "%s/UIWebView/WKWebView/g"
  6. Click enter

Step 2: Adding Frameworks to Your Xcode Project

  1. Select the project file from the project navigator on the left side of the project window.
  2. Select the target for where you want to add frameworks in the project settings editor.
  3. Select the “Build Phases” tab, and click the small triangle next to “Link Binary With Libraries” to view all of the frameworks in your application.
  4. To Add frameworks, click the “+” below the list of frameworks.
  5. Select WebKit.framework enter image description here
Sanket Prabhu
  • 2,232
  • 3
  • 20
  • 33