Ionic framework Ionic应用程序在重新启动设备或从后台杀死应用程序后反映旧版本的UI
我的Ionic应用程序有问题。当我从ionic dashboard创建一个构建并将其安装到我的设备中时,问题非常奇怪,一切正常,但如果我重新启动设备或从后台终止应用程序,然后打开应用程序,则反映了我的旧内容。就像旧的UI屏幕一样 我做了以下事情来解决它Ionic framework Ionic应用程序在重新启动设备或从后台杀死应用程序后反映旧版本的UI,ionic-framework,ionic3,ionic4,Ionic Framework,Ionic3,Ionic4,我的Ionic应用程序有问题。当我从ionic dashboard创建一个构建并将其安装到我的设备中时,问题非常奇怪,一切正常,但如果我重新启动设备或从后台终止应用程序,然后打开应用程序,则反映了我的旧内容。就像旧的UI屏幕一样 我做了以下事情来解决它 运行ionic平台删除android然后ionic平台添加android 运行cordova clean 但这些对我不起作用 config.xml <?xml version='1.0' encoding='utf-8'?> <
ionic平台删除android
然后ionic平台添加android
cordova clean
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.example" version="1.0.21" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>App Name </name>
<description>App Name</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
<content src="index.html" />
<allow-navigation href="*" />
<allow-intent href="*" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="SplashScreenDelay" value="0" />
<preference name="loadUrlTimeoutValue" value="60000" />
<preference name="android-windowSoftInputMode" value="adjustResize" />
<preference name="SplashScreen" value="screen" />
<preference name="AutoHideSplashScreen" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="true" />
<preference name="ShowSplashScreenSpinner" value="true" />
<preference name="FadeSplashScreen" value="true" />
<preference name="UseSwiftLanguageVersion" value="4.2" />
<platform name="android">
<allow-intent href="market:*" />
<preference name="android-targetSdkVersion" value="28" />
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
</platform>
<platform name="ios">
<edit-config file="*-Info.plist" mode="merge" target="NSCameraUsageDescription">
<string>To scan barcodes</string>
</edit-config>
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<plugin name="cordova-plugin-device" spec="1.1.4" />
<plugin name="cordova-plugin-statusbar" spec="2.2.2" />
<plugin name="cordova-plugin-sslcertificatechecker" spec="5.1.0" />
<plugin name="cordova-plugin-certificates" spec="^0.6.4" />
<plugin name="cordova-plugin-http" spec="1.2.0" />
<plugin name="cordova-plugin-file" spec="^6.0.1" />
<plugin name="cordova-plugin-splashscreen" spec="^4.0.0" />
<plugin name="cordova-plugin-ionic" spec="^2.0.4">
<variable name="APP_ID" value="e363211c" />
<variable name="CHANNEL_NAME" value="Production" />
<variable name="UPDATE_METHOD" value="background" />
<variable name="UPDATE_API" value="https://api.ionicjs.com" />
<variable name="MAX_STORE" value="2" />
</plugin>
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
<plugin name="cordova-plugin-x-socialsharing" spec="^5.4.0" />
<plugin name="cordova-plugin-whitelist" spec="1.3.3" />
<plugin name="cordova-plugin-datepicker" spec="0.9.3" />
<allow-navigation href="http://192.168.2.26:8100" />
<engine name="ios" spec="5.0.0" />
<engine name="android" spec="6.3.0" />
<engine name="browser" spec="5.0.4" />
在您的config.xml和package.json中,尝试将
的“更新方法”:“背景”
更改为的“更新方法”:“无”
在RND之后,我发现这是离子仪表板的问题。
Ionic dashboard有频道。我们在频道上添加git提交以更新Ionic应用程序
详情如下
<plugin name="cordova-plugin-ionic" spec="^2.0.4">
<variable name="APP_ID" value="e363211c" />
<variable name="CHANNEL_NAME" value="Production" />
<variable name="UPDATE_METHOD" value="background" />
<variable name="UPDATE_API" value="https://api.ionicjs.com" />
<variable name="MAX_STORE" value="2" />
</plugin>
在我的ionic dashboard“Production”频道中有一个旧版本提交,这就是为什么当应用程序在后台从ionic dashboard更新时,它会使用旧版本
为了解决这个问题,我在生产频道中添加了新的提交,应用程序工作正常。这可能只包括一件事,即存储在阵列中的数据被查看,而没有保存到存储器或任何地方,因此当重新启动应用程序或强制清除打开的应用程序列表中的应用程序时,阵列将关闭,因此,它包含了每次应用程序启动时已经推送到阵列中的旧数据。感谢您的建议。Mostafa您能告诉我如何修复它的过程吗?您可以安装NativeStorage或Storage来开始保存数据,并且每次输入新数据时,您都会将项目推入存储器或本机存储器,您可以搜索它并获得答案,但如果您没有找到示例,告诉我一个我可以在这里给出方法和安装的答案。这里没有存储问题。当我从后台关闭应用程序时,我的应用程序会转到上一个版本。它反映了旧的vserion UI屏幕。这与存储和阵列无关
<plugin name="cordova-plugin-ionic" spec="^2.0.4">
<variable name="APP_ID" value="e363211c" />
<variable name="CHANNEL_NAME" value="Production" />
<variable name="UPDATE_METHOD" value="background" />
<variable name="UPDATE_API" value="https://api.ionicjs.com" />
<variable name="MAX_STORE" value="2" />
</plugin>