【问题标题】:Code-push releases well but doesn't arrive to the application代码推送发布良好,但未到达应用程序
【发布时间】:2019-09-27 22:52:57
【问题描述】:

我正在使用 ionic 4 框架,我在 android 应用程序上工作,一切都很好,之后我尝试使用 code-push-plugin 发布我的应用程序更新插件并将其导入app.module,一切正常,所以我使用“ionic cordova build android”构建调试版本并在我的应用程序中进行一些更改(检查插件)并使用“code-push release-cordova MyApp android” " 发布更新。它上传得很好,但从未在我的应用程序中显示

我检查了应用中心并转到暂存版本,我发现了我的版本更新

这是我的 app.componant.ts 文件

import { CodePush } from '@ionic-native/code-push/ngx';


@Component({
  selector: 'app-root',
  templateUrl: 'app.component.html'
})
export class AppComponent {
  constructor(
   .
   .
   .
    private codePush: CodePush,
   .
  ) {

    this.initializeApp();
  }


  initializeApp() {
    this.platform.ready().then(() => {

      this.codePush.sync().subscribe((syncStatus) => console.log(syncStatus));

      const downloadProgress = (progress) => { console.log(`Downloaded 
      ${progress.receivedBytes} of ${progress.totalBytes}`); }
      this.codePush.sync({}, downloadProgress).subscribe((syncStatus) => 
      console.log(syncStatus));

   this.statusBar.styleDefault();
   this.splashScreen.hide();
});
}

这是我的 config.xml

<?xml version='1.0' encoding='utf-8'?>
..
    <platform name="android">
        <preference name="CodePushDeploymentKey" value="TM8jRvULboCjSVhDzApTk6Yu7Kry97c78f7d-6a98-4378-a263-abd88ec58996" />
...
    </platform>

【问题讨论】:

    标签: angular cordova ionic-framework ionic4 code-push


    【解决方案1】:

    检查您的日志。应该有[CodePush] 标签,你应该看到一些关于检查更新的消息。 如果您看到这些消息,请检查目标二进制版本。它应该与您的应用程序版本相同。 如果您没有看到这些消息,则表示 CodePush 设置或配置存在问题。

    【讨论】:

      猜你喜欢
      • 2021-12-07
      • 1970-01-01
      • 2014-03-04
      • 1970-01-01
      • 2018-05-03
      • 1970-01-01
      • 1970-01-01
      • 2018-12-09
      • 1970-01-01
      相关资源
      最近更新 更多