【发布时间】: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