先前已記錄:棄用API的使用情況 (Deprecated API Usage),也先行移除專案自己寫的UIWebView,現在要進行移除第三方套件中的UIWebView!
想要移除第三方套件中的UIWebView其實不難,只要套件作者願意移除,然後使用套件的開發者更新版本,就能順利完成!若該套件是非常被廣泛使用,其他開發者肯定會很早就提醒套件作者。像是AFNetWorking和Admob。
不是說2020年12月上傳ipa才會擋?原來今年第一次上傳ipa的App,直接被迫要使用WKWebView,不然連送審都不行哪~
Dear Developer,
We identified one or more issues with a recent delivery for your app, “油價管家" 1.0.1 (1). 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
如何知道自己用的第三方套件存在UIWebView?
在終端機打指令:
grep -r UIWebView .
或是在Xcode全域搜尋:
關於AFNetWorking
有開發者發現Cocopods不要全部拉下來,只要拉其中四個部分,就不會有UIWebView的存在。
pod ‘AFNetworking’
改為
pod ‘AFNetworking/Serialization’
pod ‘AFNetworking/Security’
pod ‘AFNetworking/NSURLSession’
pod ‘AFNetworking/Reachability’
關於Admob
開發者回應Release Notes:
7.55.0 2020‑02‑04
Removed all references to UIWebView. UIWebView is no longer supported.
只要更新到7.55之後的版本,就能解決問題!
參考:去除AFNetWorking中UIWebView分類、Google Mobile Ads SDK Developers。
Comments on: "[iOS] 移除第三方套件中的UIWebView" (2)
拿到舊的專案,上傳 App Store 時才發現,第三方套件有包含 UIWebView。
AFNetworking 和 GT3Captcha,好在這兩套件都有更新,下載回來不用改就可以編譯成功。
https://www.jianshu.com/p/32a0717366b2
解決方案二:
使用cocoapods導入的AFNetWorking,可以更改一下pod的方式。
之前是把整個AFNetWorking的庫都pod到項目中了。如果你和我的情況一樣沒有用到AFNetWorking中UIKit下的一些東西,可以進行如下動作:
1先前在podfile中我們是
pod ‘AFNetworking’, ‘~> 3.2.1’
2現在改為把有用到AFNetWorking庫中的指定類pod到項目中
pod ‘AFNetworking’, ‘~> 3.2.1’, :subspecs => [‘Reachability’, ‘Serialization’, ‘Security’, ‘NSURLSession’]
3改為第二步指定pod指定的類會導致報錯
4由於我的項目中是封裝的網絡請求類,所以這裡只是用了AFHTTPSessionManager這個類,所以我在網絡請求類中導入了這個頭文件就ok了。
#import “AFNetworking/AFHTTPSessionManager.h"
讚Liked by 1 person
[…] 還記得2020年底前,必須把UIWebView全面改成WKWebView,這些也在這篇文章提及:棄用API的使用情況 (Deprecated API Usage)。並且我在最近把第三方套件中的UIWebView移除。 […]
讚讚