gpt4 book ai didi

ios - 由于 UIWebView API 已弃用,因此无法在 Appstore 上发布。如何正确迁移到 WKWebView?

转载 作者:行者123 更新时间:2023-12-01 16:01:00 25 4
gpt4 key购买 nike

由于 UIWebView 的 API 已弃用,我正在努力在 App Store 上发布 Cordova 应用程序。 (ITMS-90809:不推荐使用的 API 使用 - 不再接受使用 UIWebView 的新应用程序)
我已经更新了各种插件的版本,并在 .xml 文件中添加了以下规则:

<preference name="WKWebViewOnly" value="true" />
<feature name="CDVWKWebViewEngine">`
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
随后,我使用了 cordova build ios命令(无论如何我注意到在项目中仍然有 UIWebView 标签,但据我所知这应该不是问题)。
这是 .xml 文件:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.driver.app" version="1.0.1" versionCode="1"
xmlns="http://www.w3.org/ns/widgets"
xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Driver App</name>
<description>
Driver App
</description>
<author email="info@creact.it" href="http://cordova.io">
jafood.it
</author>
<icon src="icon.png" />
<access origin="*" />
<allow-navigation href="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<access launch-external="yes" origin="tel:*" />
<content src="index.html" />
<preference name="orientation" value="portrait" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="SplashScreenDelay" value="10000" />
<preference name="AndroidPersistentFileLocation" value="Compatibility" />
<preference name="fullscreen" value="false" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="android-minSdkVersion" value="19" />
<preference name="android-targetSdkVersion" value="28" />
<preference name="DisallowOverscroll" value="true" />
<preference name="cordova.plugins.diagnostic.modules" value="LOCATION WIFI CAMERA NOTIFICATIONS MICROPHONE CONTACTS CALENDAR REMINDERS" />
<platform name="android">
<replace-string file="project.properties" find="com.google.android.gms:play-services-maps:+" replace="com.google.android.gms:play-services-maps:15.0.0" />
<replace-string file="project.properties" find="com.google.android.gms:play-services-location:16.0.0" replace="com.google.android.gms:play-services-location:15.0.0" />
<replace-string file="project.properties" find="com.google.android.gms:play-services-location:28.+" replace="com.google.android.gms:play-services-location:15.0.0" />
<replace-string file="project.properties" find="com.google.android.gms:play-services-location:+" replace="com.google.android.gms:play-services-location:15.0.0" />
<replace-string file="project.properties" find="com.google.firebase:firebase-messaging:17.0.+" replace="com.google.firebase:firebase-messaging:17.0.0" />
<resource-file src="www/beep.wav" target="app/src/main/res/raw/beep.wav" />
<resource-file src="www/beep.wav" target="res/raw/beep.wav" />
<resource-file src="google-services.json" target="google-services.json" />
<resource-file src="google-services.json" target="app/google-services.json" />
<allow-intent href="market:*" />
<icon density="ldpi" src="res/icons/android/drawable-ldpi-icon.png" />
<icon density="mdpi" src="res/icons/android/drawable-mdpi-icon.png" />
<icon density="hdpi" src="res/icons/android/drawable-hdpi-icon.png" />
<icon density="xhdpi" src="res/icons/android/drawable-xhdpi-icon.png" />
<icon density="xxhdpi" src="res/icons/android/drawable-xxhdpi-icon.png" />
<icon density="xxxhdpi" src="res/icons/android/drawable-xxxhdpi-icon.png" />
<splash density="land-ldpi" src="res/screens/android/drawable-land-ldpi-screen.png" />
<splash density="land-mdpi" src="res/screens/android/drawable-land-mdpi-screen.png" />
<splash density="land-hdpi" src="res/screens/android/drawable-land-hdpi-screen.png" />
<splash density="land-xhdpi" src="res/screens/android/drawable-land-xhdpi-screen.png" />
<splash density="land-xxhdpi" src="res/screens/android/drawable-land-xxhdpi-screen.png" />
<splash density="land-xxxhdpi" src="res/screens/android/drawable-land-xxxhdpi-screen.png" />
<splash density="port-ldpi" src="res/screens/android/drawable-port-ldpi-screen.png" />
<splash density="port-mdpi" src="res/screens/android/drawable-port-mdpi-screen.png" />
<splash density="port-hdpi" src="res/screens/android/drawable-port-hdpi-screen.png" />
<splash density="port-xhdpi" src="res/screens/android/drawable-port-xhdpi-screen.png" />
<splash density="port-xxhdpi" src="res/screens/android/drawable-port-xxhdpi-screen.png" />
<splash density="port-xxxhdpi" src="res/screens/android/drawable-port-xxxhdpi-screen.png" />
</platform>
<platform name="ios">
<edit-config file="*-Info.plist" mode="merge" target="NSLocationWhenInUseUsageDescription">
<string>Need location access to find restaurant nearby</string>
</edit-config>
<edit-config file="*-Info.plist" mode="merge" target="NSLocationAlwaysAndWhenInUseUsageDescription">
<string>Need location access to find restaurant nearby</string>
</edit-config>
<edit-config file="*-Info.plist" mode="merge" target="NSLocationAlwaysUsageDescription">
<string>Need location access to find restaurant nearby</string>
</edit-config>
<edit-config file="*-Info.plist" mode="merge" target="NSCameraUsageDescription">
<string>need camera access to take pictures</string>
</edit-config>
<edit-config file="*-Info.plist" mode="merge" target="NSPhotoLibraryUsageDescription">
<string>need to photo library access to get pictures from there</string>
</edit-config>
<edit-config file="*-Info.plist" mode="merge" target="NSLocationWhenInUseUsageDescription">
<string>need location access to find things nearby</string>
</edit-config>
<edit-config file="*-Info.plist" mode="merge" target="NSLocationAlwaysAndWhenInUseUsageDescription">
<string>need location access to find things nearby</string>
</edit-config>
<edit-config file="*-Info.plist" mode="merge" target="NSPhotoLibraryAddUsageDescription">
<string>need to photo library access to save pictures there</string>
</edit-config>
<edit-config file="*-Info.plist" mode="merge" target="NSLocationAlwaysUsageDescription">
<string>need location access to find things nearby</string>
</edit-config>
<icon height="57" platform="ios" src="res/icons/ios/icon.png" width="57" />
<icon height="114" platform="ios" src="res/icons/ios/icon@2x.png" width="114" />
<icon height="40" platform="ios" src="res/icons/ios/icon-40.png" width="40" />
<icon height="80" platform="ios" src="res/icons/ios/icon-40@2x.png" width="80" />
<icon height="50" platform="ios" src="res/icons/ios/icon-50.png" width="50" />
<icon height="100" platform="ios" src="res/icons/ios/icon-50@2x.png" width="100" />
<icon height="60" platform="ios" src="res/icons/ios/icon-60.png" width="60" />
<icon height="120" platform="ios" src="res/icons/ios/icon-60@2x.png" width="120" />
<icon height="180" platform="ios" src="res/icons/ios/icon-60@3x.png" width="180" />
<icon height="72" platform="ios" src="res/icons/ios/icon-72.png" width="72" />
<icon height="144" platform="ios" src="res/icons/ios/icon-72@2x.png" width="144" />
<icon height="76" platform="ios" src="res/icons/ios/icon-76.png" width="76" />
<icon height="152" platform="ios" src="res/icons/ios/icon-76@2x.png" width="152" />
<icon height="29" platform="ios" src="res/icons/ios/icon-small.png" width="29" />
<icon height="58" platform="ios" src="res/icons/ios/icon-small@2x.png" width="58" />
<icon height="87" platform="ios" src="res/icons/ios/icon-small@3x.png" width="87" />
<icon height="1024" platform="ios" src="res/icons/ios/icon-1024.png" width="1024" />
<splash height="1136" platform="ios" src="res/screens/ios/Default-568h@2x~iphone.png" width="640" />
<splash height="1334" platform="ios" src="res/screens/ios/Default-667h.png" width="750" />
<splash height="2208" platform="ios" src="res/screens/ios/Default-736h.png" width="1242" />
<splash height="1242" platform="ios" src="res/screens/ios/Default-Landscape-736h.png" width="2208" />
<splash height="1536" platform="ios" src="res/screens/ios/Default-Landscape@2x~ipad.png" width="2048" />
<splash height="768" platform="ios" src="res/screens/ios/Default-Landscape~ipad.png" width="1024" />
<splash height="2048" platform="ios" src="res/screens/ios/Default-Portrait@2x~ipad.png" width="1536" />
<splash height="1024" platform="ios" src="res/screens/ios/Default-Portrait~ipad.png" width="768" />
<splash height="960" platform="ios" src="res/screens/ios/Default@2x~iphone.png" width="640" />
<splash height="480" platform="ios" src="res/screens/ios/Default~iphone.png" width="320" />
<preference name="WKWebViewOnly" value="true" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
</platform>
<plugin name="cordova-plugin-insomnia" spec="4.1.0" />
<plugin name="cordova-plugin-googlemaps-plus" spec="~1.4.0">
<variable name="API_KEY_FOR_ANDROID" value="AIzaSyCCbsxetNp6A0j0h8DmzgyBhqyGuTlpTOc" />
<variable name="API_KEY_FOR_IOS" value="AIzaSyCCbsxetNp6A0j0h8DmzgyBhqyGuTlpTOc" />
</plugin>
<plugin name="cordova-plugin-whitelist" spec="^1.3.4" />
<plugin name="cordova-plugin-device" spec="^2.0.3" />
<plugin name="cordova-plugin-inappbrowser" spec="^3.2.0" />
<plugin name="cordova-plugin-splashscreen" spec="^5.0.3" />
<plugin name="cordova-plugin-geolocation" spec="^4.0.2" />
<plugin name="cordova-plugin-network-information" spec="^2.0.2" />
<plugin name="cordova-plugin-x-toast" spec="^2.6.2" />
<plugin name="cordova-plugin-media" spec="^3.0.1" />
<plugin name="cordova-plugin-vibration" spec="^2.1.6" />
<plugin name="cordova-plugin-file-transfer" spec="^1.6.3" />
<plugin name="cordova-plugin-advanced-http" spec="^2.4.1">
<variable name="OKHTTP_VERSION" value="3.10.0" />
</plugin>
<plugin name="cordova-plugin-android-permissions" spec="^1.0.2" />
<plugin name="cordova-plugin-camera" spec="^4.1.0">
<variable name="CAMERA_USAGE_DESCRIPTION" value="" />
<variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="" />
<variable name="ANDROID_SUPPORT_V4_VERSION" value="27.+" />
</plugin>
<plugin name="cordova.plugins.diagnostic" spec="^5.0.1">
<variable name="ANDROID_SUPPORT_VERSION" value="28.+" />
</plugin>
<plugin name="cordova-android-support-gradle-release" spec="^3.0.1">
<variable name="ANDROID_SUPPORT_VERSION" value="27.+" />
</plugin>
<plugin name="cordova-plugin-platform-replace" spec="^1.0.1" />
<plugin name="cordova-plugin-request-location-accuracy" spec="^2.3.0">
<variable name="PLAY_SERVICES_LOCATION_VERSION" value="15.0.0" />
</plugin>
<plugin name="cordova-support-google-services" spec="~1.3.2" />
<plugin name="cordova-plugin-mauron85-background-geolocation" spec="~3.0.1">
<variable name="GOOGLE_PLAY_SERVICES_VERSION" value="11+" />
<variable name="ANDROID_SUPPORT_LIBRARY_VERSION" value="26+" />
<variable name="ALWAYS_USAGE_DESCRIPTION" value="App requires ..." />
<variable name="MOTION_USAGE_DESCRIPTION" value="App requires motion detection" />
<variable name="SMALL_ICON" value="@mipmap/ic_launcher" />
<variable name="ICON" value="@mipmap/ic_launcher" />
</plugin>
<plugin name="cordova-plugin-buildinfo" spec="4.0.0" />
<plugin name="nl.x-services.plugins.insomnia" spec="~4.1.0" />
<plugin name="phonegap-plugin-push" spec="^2.3.0">
<variable name="SENDER_ID" value="85075801930" />
<variable name="ANDROID_SUPPORT_V13_VERSION" value="27.+" />
<variable name="FCM_VERSION" value="17.0.+" />
</plugin>
<engine name="android" spec="^8.1.0" />
<engine name="browser" spec="~5.0.4" />
<engine name="ios" spec="^4.5.5" />
</widget>
Appstore 仍然拒绝发布。
我错过了一些步骤吗?
我怀疑在尝试发布应用程序之前,我必须遵循不同的步骤来构建应用程序。

最佳答案

您正在使用 preference旗帜 WKWebViewOnly它需要cordova-ios平台版本 5.1.1 .您还需要添加cordova-plugin-wkwebview-engine使cordova使用的插件WKWebView而不是 UIWebView .
请引用此How to User 'WKWebViewOnly'
您的某些插件可能仍在使用 UIWebView .确保更新这些插件,例如:cordova-plugin-inappbrowser4.0.0使用 UIWebView 解决问题后如果您使用文件协议(protocol)在本地加载文件,您可能会遇到 CORS 问题。要解决这些问题,请将以下两个插件添加到您的项目中。cordova-plugin-wkwebview-file-xhrcordova-plugin-wkwebviewxhrfix

关于ios - 由于 UIWebView API 已弃用,因此无法在 Appstore 上发布。如何正确迁移到 WKWebView?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63524031/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com