After uploading the App to appstoreconnect,we receive this message:
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 am integrating AFNetworking by CocoaPods,I wonder how can i delete the files that using UIWebView related API.
We're receiving the same error uploading an app to App Store Connect.
@lorenzOliveto I just drag the code to project,and delete the file about UIWebView.There will be some framework that I can not modify the source code,so we ignore them,and try to submit to Apple Reveiew,wait for reviewing result.
I also encountered this problem.
@lorenzOliveto I just drag the code to project,and delete the file about UIWebView.There will be some framework that I can not modify the source code,so we ignore them,and try to submit to Apple Reveiew,wait for reviewing result.
How did you solve it? Delete the uiwebview code?
I also encountered this problem.
Made a fix (didn't have time to test it though) for this issue check the PR:
https://github.com/AFNetworking/AFNetworking/pull/4430
Same Error!!
Same error here. Can we maybe expect this to be fixed in next release?
@seanLee If you integrate AFNetworking with Cocoapods and you don't need AFNetworking/UIKit subspec, you could define your podfile like this:
pod 'AFNetworking', '~> 2.0', :subspecs => ['Reachability', 'Serialization', 'Security', 'NSURLSession', 'NSURLConnection']
Define your version number properly and depends on your dependences you could remove NSURLConnection.
@kirian I just drag the files into project, delete the category of UIWebView. Although other category are less used,the category of UIImageView is very useful.
Same problem. It would be better if we could just update the Pod rather than manually add to .the project.
So how to resolve the question?
@leviduan The answer was given by Kirian above. Change your Podfile to
pod 'AFNetworking', '~> 3.0', :subspecs => ['Reachability', 'Serialization', 'Security', 'NSURLSession']
@xaphod That's not an option if you are actually using stuff from the UIKit subspec.
At some point in the near future Apple will not permit Apps to the App Store that are using the UIKit subspec. So as I see it there is no other option but to remove all references to UIWebView from the library (or making it somehow optional).
Adding the same functionality for WKWebView is of course nice, but could also happen in a second step.
Removing the UIWebView category would mean breaking changes to the library though. Not sure if this would be a problem regarding semantic versioning.
@jjochen It's been deprecated since iOS 8. One would expect that people migrated already, and if not they had enough time in my opinion to switch. Like Apple does, I would just remove the UIWebView even if it's a breaking change. People can still use the previous version of AFNetworking if they choose to not upgrade.
Delete the UIWebView+AFNetworking.h and UIWebView+AFNetworking.m files.
The app can be approved, and it’s just Apple warning.
But follow up to solve it.
@sam-xiaohua for now yes, but I wouldn't be surprised if Apple stops accepting Apps that contains UIWebView references soon.
@seanLee If you integrate
AFNetworkingwithCocoapodsand you don't needAFNetworking/UIKitsubspec, you could define your podfile like this:
pod 'AFNetworking', '~> 2.0', :subspecs => ['Reachability', 'Serialization', 'Security', 'NSURLSession', 'NSURLConnection']
Define your version number properly and depends on your dependences you could removeNSURLConnection.
with this change I loss AFNetworking.h that I need in my project
@seanLee If you integrate
AFNetworkingwithCocoapodsand you don't needAFNetworking/UIKitsubspec, you could define your podfile like this:
pod 'AFNetworking', '~> 2.0', :subspecs => ['Reachability', 'Serialization', 'Security', 'NSURLSession', 'NSURLConnection']
Define your version number properly and depends on your dependences you could removeNSURLConnection.with this change I loss AFNetworking.h that I need in my project
any solution if AFNetworking.h is still required?
@atrebbi @superHELLd with my approach, you shouldn't include AFNetworking.h, you could import the header file which contains the specific class that you are using in your code. like AFNetworkingSessionManager.h :)
any solution for this.
I am using AFNetworking indirectly through other libraries which definetely call into AFNetworking extended UIWebView methods. Is a WKWebView replacement at all on the horizon/possible?
Hey everybody,
Waiting for PR approval and plans of a new release of AFNetworking.
How long do I have to wait for PR approval?
@seanLee If you integrate
AFNetworkingwithCocoapodsand you don't needAFNetworking/UIKitsubspec, you could define your podfile like this:
pod 'AFNetworking', '~> 2.0', :subspecs => ['Reachability', 'Serialization', 'Security', 'NSURLSession', 'NSURLConnection']
Define your version number properly and depends on your dependences you could removeNSURLConnection.with this change I loss AFNetworking.h that I need in my project
any solution if AFNetworking.h is still required?
try #import <AFNetworking/AFNetworking-umbrella.h>
I looked at various work arounds for continuing with v3.2.1, and excluding UIWebView, and then realised that I could simply un-check "Target Membership" of AFNetworking for the file UIWebView+AFNetworking.m in Xcode's right column File Inspector tab.
I also un-checked UIKit+AFNetworking.h and UIWebView+AFNetworking.h
I've not attempted a release but I have uploaded 2 binaries and neither has been reported by ITC as failing due to the inclusion of UIWebView. They work fine on TestFlight.
I assume they'll also pass review for release?
EDIT: I should have added that I use AFN in my Apps as a Pod.
@Seoras
do you use
pod 'AFNetworking', '~> 3.0', :subspecs => ['Reachability','NSURLSession']
@Seoras
do you usepod 'AFNetworking', '~> 3.0', :subspecs => ['Reachability','NSURLSession']
Didn't work for me as I am using another AFN extension pod which meant that due to the pod dependancy rules all of AFN 3.2.1 was being included and the subspecs where being ignored.
@Seoras would you show your pod list which cause this pod dependancy ?
Just add
pod 'AFNetworking+RetryPolicy'
You may like to try my fork: https://github.com/ElfSundae/AFNetworking
UIWebView related codeNSURLSessionTaskMetrics #4516You can compare changes here.
Installation:
CocoaPods
pod 'AFNetworking', '~> 3.0', :source => 'https://github.com/ElfSundae/CocoaPods-Specs.git'
Carthage
github "ElfSundae/AFNetworking" ~> 3.0
Same problem. It would be better if we could just update the Pod rather than manually add to .the project.
Add this code in you Podfile, for just remove the files releated UIWebView automatic.
pre_install do |installer|
puts 'pre_install begin....'
dir_af = File.join(installer.sandbox.pod_dir('AFNetworking'), 'UIKit+AFNetworking')
Dir.foreach(dir_af) {|x|
real_path = File.join(dir_af, x)
if (!File.directory?(real_path) && File.exists?(real_path))
if((x.start_with?('UIWebView') || x == 'UIKit+AFNetworking.h'))
File.delete(real_path)
puts 'delete:'+ x
end
end
}
puts 'end pre_install.'
end
end
If you're already using CocoaPods, just use the subspecs, no need to delete files.
If you're already using CocoaPods, just use the subspecs, no need to delete files.
I had tried to use subspecs, but found it's not fit me, because my project use another files in UIKit subspec besides UIKit/UIWebView+AFNetworking.h/m, such as UIKit/AFImageDownloader.h
If you're already using CocoaPods, just use the subspecs, no need to delete files.
@jshier If you think that shipping a library with a default configuration that will be rejected by Apple is nothing to sweat about, don't you think that this should at least be documented in the Installation with CocoaPods section of the README file.
@seanLee If you integrate
AFNetworkingwithCocoapodsand you don't needAFNetworking/UIKitsubspec, you could define your podfile like this:
pod 'AFNetworking', '~> 2.0', :subspecs => ['Reachability', 'Serialization', 'Security', 'NSURLSession', 'NSURLConnection']
Define your version number properly and depends on your dependences you could removeNSURLConnection.with this change I loss AFNetworking.h that I need in my project
seems not work...still install the whole pod
This is a major problem also when using the AFgzipRequestSerializer pod as it depends on AFNetworking/UIKit.
So defining the subspecs won't work.
@isimpson You may fork this repo, remove UIWebView related stuff, then specify repo URL in your Podfile or Cartfile like:
pod 'AFNetworking', :git => 'https://github.com/your/fork'
That is all, no need to change anything else.
Or you may consider using my fork: https://github.com/ElfSundae/AFNetworking/issues/1
@isimpson You may fork this repo, remove UIWebView related stuff, then specify repo URL in your Podfile or Cartfile like:
pod 'AFNetworking', :git => 'https://github.com/your/fork'That is all, no need to change anything else.
Or you may consider using my fork: ElfSundae#1
I'm using your fork. Thanks!
@seanLee If you integrate
AFNetworkingwithCocoapodsand you don't needAFNetworking/UIKitsubspec, you could define your podfile like this:
pod 'AFNetworking', '~> 2.0', :subspecs => ['Reachability', 'Serialization', 'Security', 'NSURLSession', 'NSURLConnection']
Define your version number properly and depends on your dependences you could removeNSURLConnection.with this change I loss AFNetworking.h that I need in my project
AFNetWorking.h is not available since we use subspaces ,so depends on what feature we need, we should use #import <AFURLSessionManager.h> for 'NSURLSession' instead.
See #4439
Updated, released. Can be closed.
You may like to try my fork: https://github.com/ElfSundae/AFNetworking
- ✅ The latest commit on the master branch
- ✅ Removed
UIWebViewrelated code- ✅ Fixed API availability warnings for
NSURLSessionTaskMetrics#4516You can compare changes here.
Installation:
- CocoaPods
ruby pod 'AFNetworking', '~> 3.0', :source => 'https://github.com/ElfSundae/CocoaPods-Specs.git'- Carthage
github "ElfSundae/AFNetworking" ~> 3.0
it is worked. Thank you very much
@coskungun just upgrade the library to version 4
pod 'AFNetworking', '~> 4.0'
@seanLee If you integrate
AFNetworkingwithCocoapodsand you don't needAFNetworking/UIKitsubspec, you could define your podfile like this:
pod 'AFNetworking', '~> 2.0', :subspecs => ['Reachability', 'Serialization', 'Security', 'NSURLSession', 'NSURLConnection']
Define your version number properly and depends on your dependences you could removeNSURLConnection.with this change I loss AFNetworking.h that I need in my project
any solution if AFNetworking.h is still required?
why do you require AFNetworking.h ?
it contents only imports

you should import only headers you need
...
Most helpful comment
Add this code in you Podfile, for just remove the files releated UIWebView automatic.