我正在尝试使用具有Ionic原生的Microsoft Code Push。我按照教程设置了。
我安装了cordov aplugin + npm ionic native。
我的config.xml是
<platform name="android">
<allow-intent href="market:*"/>
<preference name="CodePushDeploymentKey" value="aLu85u3-jcq8Kydtkoo5LmQsFUQMEy2AEB---"/>
</platform>
我的app.component.ts是::
`initializeApp() {
this.platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
this.statusBar.styleDefault();
this.splashScreen.hide();
if(this.platform.is("mobile")){
this._codePush.sync().subscribe((syncStatus) => console.log(syncStatus));
}
});
}`
但这会在设备上给我错误
Failed to load resource: the server responded with a status of 404 (Not Found)
plugins/cordova-plugin-code-push/bin/www/codePushUtil.js:40 [CodePush] An error occurred while reporting status: {"status":0,"appVersion":"0.0.1","deploymentKey":"aLu85u3-jcq8Kydtkoo5LmQsFUQMEy2AEB---"}
CodePushUtil.logError @ plugins/cordova-plugin-code-push/bin/www/codePushUtil.js:40
plugins/cordova-plugin-code-push/bin/www/codePushUtil.js:36 [CodePush] Checking for update.
codepush.azurewebsites.net/updateCheck?deploymentKey=aLu85u3-jcq8Kydtkoo5Lm…dd06e76f8302c3---&isCompanion=false&label=&clientUniqueId=9f0136c001a89efd Failed to load resource: the server responded with a status of 404 (Not Found)
plugins/cordova-plugin-code-push/bin/www/codePushUtil.js:40 [CodePush] 404:
CodePushUtil.logError @ plugins/cordova-plugin-code-push/bin/www/codePushUtil.js:40
plugins/cordova-plugin-code-push/bin/www/codePushUtil.js:40
答案 0 :(得分:0)
删除和添加平台解决了这个问题。