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

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

由于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的问题,并且如果使用文件协议在本地加载文件,则可能会遇到CORS问题。要解决这些问题,请在您的项目中添加以下两个插件。

cordova-plugin-wkwebview-file-xhr

cordova-plugin-wkwebviewxhrfix

,

您需要使用cordova-ios 6+,它会消失

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-