我正在使用ionic 4开发应用程序,所以我尝试使用code-push-plugin来发布我的应用程序的更新。我正确地设置了插件,并设法使用cli将更新上传到应用程序中心,但当我尝试打开我的应用程序时,什么也没有发生。
我使用"ionic cordova build android“来生成apk,以便在真实的设备上进行测试。
和"code-push release-cordova K4A android“来发布更新。
我检查了appcenter并转到staging releases,我找到了我的版本更新
下面是我用home.page.ts编写的代码
constructor( private codePush: CodePush, private platform: Platform
) {
this.platform.ready().then(()=> {
this.codePush.sync({}, (progress)=> {
}).subscribe((status) => {
if (status == SyncStatus.CHECKING_FOR_UPDATE)
alert("Checking for updates");
if (status == SyncStatus.DOWNLOADING_PACKAGE)
alert("Downloading");
if (status == SyncStatus.IN_PROGRESS)
alert("in progress");
if (status == SyncStatus.INSTALLING_UPDATE)
alert("installing the updates ...");
if (status == SyncStatus.UPDATE_INSTALLED)
alert("update installed");
if (status == SyncStatus.ERROR)
alert("Error");
})
})这是config.xml
widget id="com.KO4A.KORA" version="0.0.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<platform name="android">
<preference name="CodePushDeploymentKey" value="TM8jRvULboCjSVhDzApTk6Yu7Kry97c78f7d-6a98-4378-a263-abd88ec58996" />
</platform>
<name>K4A</name>发布于 2020-01-26 09:47:03
最典型的问题是部署密钥损坏。检查它是否与门户中的相同(或使用cli获取它)。如果正确,是否在更新过程中提供日志?日志应该包含更多信息。
https://stackoverflow.com/questions/56195511
复制相似问题